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);
@ -49,11 +46,11 @@ class _InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
return new StoreProvider<AppState>( return new StoreProvider<AppState>(
store: widget.store, store: widget.store,
child: new MaterialApp( child: new MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
localizationsDelegates: [ localizationsDelegates: [
const AppLocalizationsDelegate(), const AppLocalizationsDelegate(),
GlobalMaterialLocalizations.delegate, GlobalMaterialLocalizations.delegate,
], ],
theme: ThemeData().copyWith( theme: ThemeData().copyWith(
primaryColor: const Color(0xFF117cc1), primaryColor: const Color(0xFF117cc1),
primaryColorDark: const Color(0xFF005090), primaryColorDark: const Color(0xFF005090),
@ -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()), return LoginVM();
builder: (context, store) {
return LoginVM();
},
);
}, },
AppRoutes.dashboard: (context) { AppRoutes.dashboard: (context) {
return StoreBuilder<AppState>( StoreProvider.of<AppState>(context).dispatch(LoadDashboardAction());
onInit: (store) => store.dispatch(LoadDashboardAction()), return Dashboard();
builder: (context, store) {
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();
}, },