Refactor
This commit is contained in:
parent
86627f98ab
commit
097099d00d
|
|
@ -2,10 +2,10 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja/ui/dashboard_screen.dart';
|
||||
import 'package:invoiceninja/ui/client/client_list.dart';
|
||||
import 'package:invoiceninja/ui/product/product_screen.dart';
|
||||
import 'package:invoiceninja/ui/auth/login_screen.dart';
|
||||
import 'package:invoiceninja/ui/dashboard/dashboard.dart';
|
||||
import 'package:invoiceninja/ui/client/clients.dart';
|
||||
import 'package:invoiceninja/ui/product/products.dart';
|
||||
import 'package:invoiceninja/ui/auth/login.dart';
|
||||
import 'package:invoiceninja/routes.dart';
|
||||
import 'package:invoiceninja/redux/product/product_actions.dart';
|
||||
import 'package:invoiceninja/redux/product/product_middleware.dart';
|
||||
|
|
@ -61,14 +61,14 @@ class InvoiceNinjaApp extends StatelessWidget {
|
|||
},
|
||||
);
|
||||
},
|
||||
AppRoutes.clientScreen: (context) {
|
||||
AppRoutes.clients: (context) {
|
||||
return StoreBuilder<AppState>(
|
||||
builder: (context, store) {
|
||||
return ClientList();
|
||||
},
|
||||
);
|
||||
},
|
||||
AppRoutes.productScreen: (context) {
|
||||
AppRoutes.products: (context) {
|
||||
return StoreBuilder<AppState>(
|
||||
onInit: (store) => store.dispatch(LoadProductsAction()),
|
||||
builder: (context, store) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class AppRoutes {
|
||||
static final login = "/";
|
||||
static final dashboard = "/dashboard";
|
||||
static final clientScreen = "/clientScreen";
|
||||
static final productScreen = "/productScreen";
|
||||
static final clients = "/clients";
|
||||
static final products = "/products";
|
||||
}
|
||||
|
|
@ -36,7 +36,7 @@ class Sidebar extends StatelessWidget {
|
|||
leading: new Icon(Icons.language),
|
||||
title: new Text('Products'),
|
||||
onTap: () {
|
||||
Navigator.of(context).popAndPushNamed(AppRoutes.productScreen);
|
||||
Navigator.of(context).popAndPushNamed(AppRoutes.products);
|
||||
},
|
||||
),
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in New Issue