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