Starter...

This commit is contained in:
Hillel Coren 2020-03-02 22:40:58 +02:00
parent d4a2a6d5e1
commit d9e17faef6
4 changed files with 40 additions and 27 deletions

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
// This version must be updated in tandem with the pubspec version.
const String kAppVersion = '2.0.2';
const String kAppVersion = '2.0.3';
const String kSiteUrl = 'https://invoiceninja.com';
//const String kAppUrl = 'https://admin.invoiceninja.com';
const String kAppUrl = 'https://staging.invoicing.co';

View File

@ -430,7 +430,8 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
return settingsUIState.isChanged;
}
if (uiState.currentRoute.endsWith('edit')) {
if (uiState.currentRoute.endsWith('/edit') ||
uiState.currentRoute.endsWith('_edit')) {
throw 'AppState.hasChanges is not defined for ${uiState.currentRoute}';
}

View File

@ -12,6 +12,10 @@ import 'package:invoiceninja_flutter/ui/app/history_drawer_vm.dart';
import 'package:invoiceninja_flutter/ui/app/menu_drawer_vm.dart';
import 'package:invoiceninja_flutter/ui/app/help_text.dart';
import 'package:invoiceninja_flutter/ui/app/screen_imports.dart';
import 'package:invoiceninja_flutter/ui/credit/credit_screen.dart';
import 'package:invoiceninja_flutter/ui/credit/credit_screen_vm.dart';
import 'package:invoiceninja_flutter/ui/credit/edit/credit_edit_vm.dart';
import 'package:invoiceninja_flutter/ui/credit/view/credit_view_vm.dart';
import 'package:invoiceninja_flutter/ui/payment/refund/payment_refund_vm.dart';
import 'package:invoiceninja_flutter/ui/reports/reports_screen.dart';
import 'package:invoiceninja_flutter/ui/reports/reports_screen_vm.dart';
@ -106,6 +110,14 @@ class MainScreen extends StatelessWidget {
editWidget: QuoteEditScreen(),
);
break;
case CreditScreen.route:
screen = EntityScreens(
entityType: EntityType.credit,
listWidget: CreditScreenBuilder(),
viewWidget: CreditViewScreen(),
editWidget: CreditEditScreen(),
);
break;
case ProjectScreen.route:
screen = EntityScreens(
entityType: EntityType.project,

View File

@ -72,20 +72,20 @@ class CreditScreen extends StatelessWidget {
onSavePressed: listUIState.selectedIds.isEmpty
? null
: (context) async {
final credits = listUIState.selectedIds
.map<InvoiceEntity>(
(creditId) => viewModel.creditMap[creditId])
.toList();
final credits = listUIState.selectedIds
.map<InvoiceEntity>(
(creditId) => viewModel.creditMap[creditId])
.toList();
await showEntityActionsDialog(
entities: credits,
context: context,
multiselect: true,
completer: Completer<Null>()
..future.then<dynamic>(
(_) => store.dispatch(ClearCreditMultiselect())),
);
},
await showEntityActionsDialog(
entities: credits,
context: context,
multiselect: true,
completer: Completer<Null>()
..future.then<dynamic>(
(_) => store.dispatch(ClearCreditMultiselect())),
);
},
onCancelPressed: (context) =>
store.dispatch(ClearCreditMultiselect()),
),
@ -130,18 +130,18 @@ class CreditScreen extends StatelessWidget {
),
floatingActionButton: userCompany.canCreate(EntityType.credit)
? FloatingActionButton(
heroTag: 'credit_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.credit);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newCredit,
)
heroTag: 'credit_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.credit);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newCredit,
)
: null,
);
}