Refactor
This commit is contained in:
parent
2dbf64b048
commit
b83464f7c7
|
|
@ -92,7 +92,6 @@ class _InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
|
||||||
return LoginVM();
|
return LoginVM();
|
||||||
},
|
},
|
||||||
DashboardScreen.route: (context) {
|
DashboardScreen.route: (context) {
|
||||||
print('here...');
|
|
||||||
widget.store.dispatch(LoadDashboardAction());
|
widget.store.dispatch(LoadDashboardAction());
|
||||||
return DashboardScreen();
|
return DashboardScreen();
|
||||||
},
|
},
|
||||||
|
|
@ -105,13 +104,13 @@ class _InvoiceNinjaAppState extends State<InvoiceNinjaApp> {
|
||||||
widget.store.dispatch(LoadClients());
|
widget.store.dispatch(LoadClients());
|
||||||
return ClientScreen();
|
return ClientScreen();
|
||||||
},
|
},
|
||||||
ClientViewScreen.route: (context) => ClientEditScreen(),
|
ClientViewScreen.route: (context) => ClientViewScreen(),
|
||||||
ClientEditScreen.route: (context) => ClientEditScreen(),
|
ClientEditScreen.route: (context) => ClientEditScreen(),
|
||||||
InvoiceScreen.route: (context) {
|
InvoiceScreen.route: (context) {
|
||||||
widget.store.dispatch(LoadInvoices());
|
widget.store.dispatch(LoadInvoices());
|
||||||
return InvoiceScreen();
|
return InvoiceScreen();
|
||||||
},
|
},
|
||||||
//InvoiceViewScreen.route: (context) => InvoiceEditScreen(),
|
//InvoiceViewScreen.route: (context) => InvoiceViewScreen(),
|
||||||
InvoiceEditScreen.route: (context) => InvoiceEditScreen(),
|
InvoiceEditScreen.route: (context) => InvoiceEditScreen(),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -145,9 +145,10 @@ Middleware<AppState> _createLoadState(
|
||||||
var route = '';
|
var route = '';
|
||||||
bool isFirst = true;
|
bool isFirst = true;
|
||||||
print('current route: ' + uiState.currentRoute);
|
print('current route: ' + uiState.currentRoute);
|
||||||
|
print('auth URL: ' + authState.url);
|
||||||
uiState.currentRoute.split('/').forEach((part) {
|
uiState.currentRoute.split('/').forEach((part) {
|
||||||
if (part.isNotEmpty) {
|
if (part.isNotEmpty) {
|
||||||
if (part == 'edit' && route != '/products') {
|
if (part == 'edit' && route != '/products' && route != '/invoices') {
|
||||||
navigator.pushNamed(route + '/view');
|
navigator.pushNamed(route + '/view');
|
||||||
print('push: ' + route + '/view');
|
print('push: ' + route + '/view');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue