Refactor
This commit is contained in:
parent
d0b2deed2d
commit
a82d23f26d
|
|
@ -1,8 +1,6 @@
|
|||
import 'package:redux/redux.dart';
|
||||
import 'package:invoiceninja/redux/product/product_actions.dart';
|
||||
import 'package:invoiceninja/redux/product/product_state.dart';
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:invoiceninja/data/models/models.dart';
|
||||
|
||||
final productsReducer = combineReducers<ProductState>([
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:invoiceninja/data/models/models.dart';
|
||||
import 'package:invoiceninja/ui/app/progress_button.dart';
|
||||
import 'package:invoiceninja/ui/product/product_details_vm.dart';
|
||||
import 'package:invoiceninja/utils/localization.dart';
|
||||
|
|
@ -16,7 +15,6 @@ class ProductDetails extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
//final localizations = ArchSampleLocalizations.of(context);
|
||||
|
||||
String _productKey;
|
||||
String _notes;
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ import 'package:invoiceninja/redux/app/app_state.dart';
|
|||
|
||||
|
||||
class ProductDetailsBuilder extends StatelessWidget {
|
||||
final int id;
|
||||
|
||||
ProductDetailsBuilder({Key key, @required this.id}) : super(key: key);
|
||||
ProductDetailsBuilder({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class ProductListVM {
|
|||
isLoading: store.state.productState().lastUpdated == 0,
|
||||
onProductTap: (context, product) {
|
||||
store.dispatch(SelectProductAction(product));
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (_) => ProductDetailsBuilder(id: product.id)));
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (_) => ProductDetailsBuilder()));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class ProductScreen extends StatelessWidget {
|
|||
//key: ArchSampleKeys.addProductFab,
|
||||
onPressed: () {
|
||||
store.dispatch(SelectProductAction(ProductEntity()));
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (_) => ProductDetailsBuilder(id: 0)));
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (_) => ProductDetailsBuilder()));
|
||||
},
|
||||
child: Icon(Icons.add),
|
||||
//tooltip: ArchSampleLocalizations.of(context).addProduct,
|
||||
|
|
|
|||
Loading…
Reference in New Issue