Fix for bottom sheet

This commit is contained in:
unknown 2018-06-03 05:04:08 -07:00
parent 6775d01936
commit c270610c5b
1 changed files with 20 additions and 35 deletions

View File

@ -18,8 +18,7 @@ import 'package:invoiceninja/utils/localization.dart';
//import 'package:redux_logging/redux_logging.dart'; //import 'package:redux_logging/redux_logging.dart';
void main() { void main() {
final store = Store<AppState>( final store = Store<AppState>(appReducer,
appReducer,
initialState: AppState(), initialState: AppState(),
middleware: [] middleware: []
..addAll(createStoreAuthMiddleware()) ..addAll(createStoreAuthMiddleware())
@ -27,14 +26,12 @@ void main() {
..addAll(createStoreProductsMiddleware()) ..addAll(createStoreProductsMiddleware())
..addAll([ ..addAll([
//LoggingMiddleware.printer(), //LoggingMiddleware.printer(),
]) ]));
);
runApp(new InvoiceNinjaApp(store: store)); runApp(new InvoiceNinjaApp(store: store));
} }
class InvoiceNinjaApp extends StatefulWidget { class InvoiceNinjaApp extends StatefulWidget {
final Store<AppState> store; final Store<AppState> store;
InvoiceNinjaApp({Key key, this.store}) : super(key: key); InvoiceNinjaApp({Key key, this.store}) : super(key: key);
@ -68,34 +65,22 @@ class _InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
title: 'Invoice Ninja', title: 'Invoice Ninja',
routes: { routes: {
AppRoutes.login: (context) { AppRoutes.login: (context) {
return StoreBuilder<AppState>( StoreProvider.of<AppState>(context).dispatch(LoadUserLogin());
onInit: (store) => store.dispatch(LoadUserLogin()),
builder: (context, store) {
return LoginVM(); return LoginVM();
}, },
);
},
AppRoutes.dashboard: (context) { AppRoutes.dashboard: (context) {
return StoreBuilder<AppState>( StoreProvider.of<AppState>(context).dispatch(LoadDashboardAction());
onInit: (store) => store.dispatch(LoadDashboardAction()),
builder: (context, store) {
return Dashboard(); return Dashboard();
}, },
);
},
/*
AppRoutes.clients: (context) {
return StoreBuilder<AppState>(
builder: (context, store) {
return ClientList();
},
);
},
*/
AppRoutes.products: (context) { AppRoutes.products: (context) {
if (StoreProvider.of<AppState>(context).state.productState().isStale()) { if (StoreProvider
StoreProvider.of<AppState>(context).dispatch( .of<AppState>(context)
LoadProductsAction()); .state
.productState()
.isStale()) {
StoreProvider
.of<AppState>(context)
.dispatch(LoadProductsAction());
} }
return ProductScreen(); return ProductScreen();
}, },