adhara 0.1.46

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 83

adhara

Base framework for Flutter Apps with intense networking and data interactivity

Getting Started

For help getting started with Flutter, view our online documentation.

For help on editing package code, view the documentation.

[0.1.45] - 14th October, 2018

  • registerSocketEvents signature changed to Future registerSocketEvents(SocketIO socket);

[0.1.44] - 14th October, 2018.

  • Introducing socket connections using socket.io
  • Override registerSocketEvents from NetworkProvider and use instance level socket field to listen to events
  • Usage
      //example
      Future registerSocketEvents() async {
          await socket.on('message', (greeting) {
            print('Hello, $greeting');
          });
          await socket.emit('init', [
            {'Hello': 'world!'},
          ]);
        }
    

[0.1.43] - 14th October, 2018.

  • Optimized/Enhanced event handler. Introducing Event object

[0.1.42] - 14th October, 2018.

  • Introducing event handler. Register and trigger events across widgets.
  • Usage: inside State class extending AdharaState,
      on("eventName", handlerFn);     //to register
      off("eventName")                //to de-register
      trigger("someOtherEvent")       //to trigger event across all mounted stateful widgets
    

[0.1.41] - 13th October, 2018.

  • Removed HTTPStorageProvider support. Use KeyValue storage provider if required, or create a HTTPStorage provider extending KeyValueStorage.

[0.1.40] - 13th October, 2018.

  • Removed storage provider schema configurations. Only fields can be configured now using storage_classes

[0.1.39] - 13th October, 2018.

  • Dart 2.0 Support.

[0.1.33] - 08th October, 2018.

  • KeyValueStorageProvider - value was Unique, now changed to non unique

[0.1.32] - 28th September, 2018.

  • printing preload errors

[0.1.31] - 28th September, 2018.

  • Enforcing usage of

[0.1.30] - 28th September, 2018.

  • Config can now configure config configFile field which returns a file from assets - config file. this eases up development files...

[0.1.25] - 28th September, 2018.

  • flutter's presky setState error in development for "setState called after dispose" is suppressed by performing a check in adhara's stateful_widget

[0.1.24] - 27th September, 2018.

  • Enhanced logging for network calls

[0.1.22] - 26th September, 2018.

  • Bug Fix for constraints in Schema Columns

[0.1.21] - 24th September, 2018.

  • Enhancements in bean.dart

[0.1.19] - 21th September, 2018.

  • Bug Fixes in 0.1.0

[0.1.0] - 13th September, 2018.

  • Storage Field classes introduced. table schema can now be declared easily with introduced classes by making field types mandatory
  • Storage Field classes will support storing boolean/json fields - serialization and deserialization will be taken care by these classes

[0.0.45] - 2nd September, 2018.

  • Adding examples

[0.0.44] - 2nd September, 2018.

  • Adding shared preferences in Resources. User r.preferences to access shared_preferences API's

[0.0.42] - 29th August, 2018.

  • Reverting to previous

[0.0.41] - 29th August, 2018.

  • Upgrade all dependencies to latest

[0.0.39] - 29th August, 2018.

  • Resources made available in DataInterface by public field r.

[0.0.38] - 19th August, 2018.

  • Router's getRoute function's argument urlPatterns now accepts kwargs, ex: {"pattern": "^posts/{{postId}}([0-9]+)/edit\$", "router": NewPost.router, "kwargs": {"edit": true}},

[0.0.36] - 17th August, 2018.

  • Storage provider create table error handled for IOS

[0.0.35] - 12th August, 2018.

  • Sentry ignore strings introduced. List<String> get sentryIgnoreStrings in Config

[0.0.34] - 11th August, 2018.

  • Adding sentry. use Config.sentryDSN to configure sentry data source name

[0.0.32] - 7th August, 2018.

  • NetworkProvider enhanced. Interceptors introduced.

[0.0.30] - 4th August, 2018.

  • single instance database referred from resources. It is expected to be auto closed on app closing...

[0.0.28] - 1st August, 2018.

  • loadLanguage introduced. Can call this to load new languages whenever required

[0.0.28] - 29th July, 2018.

  • clearResources introduced. This can be called on logout from the application.
  • clearResources by default clear's AppState and calls DataInterface's clearDataStores method.
  • dataStores getter introduced in DataInterface. This must return all data stores whose creation and truncation will be handled with easy utils.

[0.0.27] - 19th July, 2018.

  • Mode utilities added

[0.0.25] - 19th July, 2018.

  • Introducing tag for AdharaState to manage state related unique variables

[0.0.22] - 19th July, 2018.

  • Dart 2 support

[0.0.22] - 19th July, 2018.

  • All calling functions enhanced with same signature

[0.0.21] - 19th July, 2018.

  • StorageProvider methods relating to get list now accepts all arguments supported by sqflite

[0.0.20] - 19th July, 2018.

  • StorageProvider delete operation Signature changes

[0.0.18] - 19th July, 2018.

  • Introducing Batch Udpate.

[0.0.16] - 18th July, 2018.

  • Created time and Updated time for all beans and storage's.

[0.0.13] - 18th July, 2018.

  • Introducing AdharaStatelessWidget. Use buildWithResources(BuildContext context, Resources r) to access resources.

[0.0.12] - 15th July, 2018.

  • Network provider failure responses now throw error

[0.0.10] - 15th July, 2018.

  • App state scope get and set method names changed to getValue setValue.
  • default value made optional for getValue

[0.0.6] - 15th July, 2018.

  • providing r as a getter in adhara stateful widget

[0.0.5] - 15th July, 2018.

  • Introducing remove in KeyValueStorageProvider

[0.0.4] - 15th July, 2018.

  • Adding option for custom data interface in config.dart

[0.0.2] - 15th July, 2018.

  • Adding URL launcher as a single function call which abstracts checks for canLaunch

[0.0.1] - 15th July, 2018.

  • AdharaStatefulWidget and AdharaSState to manage lifecycle events for data
  • Resource Handling for languages
  • Router to handle URL's by path
  • SQFLite integrated for database interactions
  • Bean (~ POJO classes from Java) based storage handlers
  • KeyValue stores in database
  • http storage for URL based storage

example/main.dart

/// appconfig.dart

//import "app.dart";  TODO uncomment
import "package:adhara/adhara.dart";
import 'package:flutter/material.dart';

//TODO declare in a separate file and implement required methods
class AppNetworkProvider extends NetworkProvider{ AppNetworkProvider(Config config):super(config); }

//TODO declare in a separate file and implement required methods
class AppDataInterface extends DataInterface{ AppDataInterface(Config config):super(config); }

class AppConfig extends Config{

  ///Return App Container Widget
  get container => App();

  ///Return Network URL
  String get baseURL{
    return isReleaseMode()
      ?"http://mysite.com/"         //TODO set production URL
      :"http://192.168.0.1:8000/";  //TODO set development URL
  }

  ///Return App Network Provider
  NetworkProvider get networkProvider => AppNetworkProvider(this);

  ///Return App Data Interface
  DataInterface get dataInterface => AppDataInterface(this);

  ///return SQLite DB Name
  String get dbName{
    return isReleaseMode()
      ?"production.db"
      :"development.db";
  }

  ///return SQLite DB Version -  to increment on new releases if required...
  int get dbVersion{
    return isReleaseMode()?1:1;
  }

  ///  Language file map will be used to display the text content where ever r.getString(RESOURCE_KEY) is used
  ///    Language file is a .properties file
  ///    Pattern: RESOURCE_KEY=RESOURCE_VALUE
  ///-----------------------------------------
  ///    key1=Value 1
  ///    key2=Value 2
  ///    ....
  ///-----------------------------------------
  Map<String, String> get languageResources => {
//  TODO create language files, refer them in pubspec assets and map it here.
    "en": "assets/languages/en.properties",
    "fr": "assets/languages/fr.properties",
    "ka": "assets/languages/te.properties",
    "hi": "assets/languages/hi.properties",
  };

}


/// app.dart
//import 'package:flutter/material.dart'; //TODO uncomment
//import 'package:adhara/adhara.dart'; //TODO uncomment

class App extends AdharaStatefulWidget {

  @override
  _AppState createState() => _AppState();

}

/*App code Starts here*/
class _AppState extends AdharaState<App> {

  @override
  void initState(){
    super.initState();
  }

  @override
  firstLoad() async {
    //    This will be called only when this widget is called for the very first time of app lifecycle
  }

  String get tag => "App";  //Unique identifier for this widget

  bool isLoggedIn;
//  Widget home = SplashScreen();

  @override
  fetchData(Resources r) async {
//    TODO perform any database queries from AppDataInterface
//  This function will be called whenever widget's init state is called. For the first time, this will be called only after firstLoad.

//    isLoggedIn = await (r.dataInterface as AppDataInterface).isLoggedIn();
//    home = isLoggedIn?HomePage():LoginPage();
//    home = HomePage();

    setState((){});
  }

  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: r.getString("app_title"),  //Query String resource from properties files... ( i18n )
      debugShowCheckedModeBanner: false,
//      home:  home,
//      onGenerateRoute: routeGenerator,
    );
  }
}

/// main.dart
//import 'package:flutter/material.dart'; //TODO uncomment
//import 'appconfig.dart'; //TODO uncomment
//import 'package:adhara/adhara.dart'; //TODO uncomment


void main() => AdharaApp.initWithConfig(AppConfig());

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  adhara: ^0.1.46

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

Alternatively, your editor might support flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:adhara/adhara.dart';
  
Version Uploaded Documentation Archive
0.1.46 Oct 15, 2018 Go to the documentation of adhara 0.1.46 Download adhara 0.1.46 archive
0.1.45 Oct 14, 2018 Go to the documentation of adhara 0.1.45 Download adhara 0.1.45 archive
0.1.44 Oct 14, 2018 Go to the documentation of adhara 0.1.44 Download adhara 0.1.44 archive
0.1.43 Oct 13, 2018 Go to the documentation of adhara 0.1.43 Download adhara 0.1.43 archive
0.1.42 Oct 13, 2018 Go to the documentation of adhara 0.1.42 Download adhara 0.1.42 archive
0.1.41 Oct 12, 2018 Go to the documentation of adhara 0.1.41 Download adhara 0.1.41 archive
0.1.40 Oct 12, 2018 Go to the documentation of adhara 0.1.40 Download adhara 0.1.40 archive
0.1.39 Oct 12, 2018 Go to the documentation of adhara 0.1.39 Download adhara 0.1.39 archive
0.1.38 Oct 12, 2018 Go to the documentation of adhara 0.1.38 Download adhara 0.1.38 archive
0.1.37 Oct 12, 2018 Go to the documentation of adhara 0.1.37 Download adhara 0.1.37 archive

All 88 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
73
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
83
Learn more about scoring.

We analyzed this package on Oct 15, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/app.dart.

Run flutter format to format lib/app.dart.

Format lib/datainterface/network/network_provider.dart.

Run flutter format to format lib/datainterface/network/network_provider.dart.

Format lib/resources/event_handler.dart.

Run flutter format to format lib/resources/event_handler.dart.

Format lib/widgets/stateful_widget.dart.

Run flutter format to format lib/widgets/stateful_widget.dart.

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: socket_io.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.61.0 <3.0.0
flutter 0.0.0
http ^0.12.0 0.12.0
path ^1.6.2 1.6.2
path_provider ^0.4.1 0.4.1
sentry ^2.1.1 2.1.1
shared_preferences ^0.4.3 0.4.3
socket_io 0.1.0
sqflite ^0.12.2+1 0.12.2+1
url_launcher ^4.0.1 4.0.1
Transitive dependencies
async 2.0.8
charcode 1.1.2
collection 1.14.11
http_parser 3.1.3
meta 1.1.6
sky_engine 0.0.99
source_span 1.4.1
stack_trace 1.9.3
string_scanner 1.0.4
synchronized 1.5.3
typed_data 1.1.6
usage 3.4.1
vector_math 2.0.8