Flutter base library.
- Model dataView manager with navigation observer
Add influx: ^0.2.0
to your pubspec.yaml
dependencies:
dependencies:
flutter:
sdk: flutter
...
influx: ^0.2.0
Import it:
import 'package:influx/influx.dart';
class AppViewState extends State<AppView>
{
...
@override
Widget build( BuildContext context )
{
return MaterialApp(
...
navigatorObservers: <NavigatorObserver>[ DataViewNavigatorObserver.instance ],
...
);
}
}
class AbcViewState extends State<AbcView> implements DataView
{
Abc
abc;
...
@override
Widget build( BuildContext build_context )
{
DataViewManager.instance.addView( this );
return Scaffold(
...
);
}
@override
void dispose()
{
DataViewManager.instance.removeView( this );
super.dispose();
}
@override
List<dynamic> getViewData()
{
return [ abc ];
}
@override
void updateView()
{
setState( () {} );
}
}
class Abc
{
...
void ChangeSomething(
)
{
...
DataViewManager.instance.updateViews( [ this ] );
}
}
0.2
Eric Pelzer (ecstatic.coder@gmail.com).
This project is licensed under the GNU Lesser General Public License version 3.
See the LICENSE file for details.