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