Navigation refactor

This commit is contained in:
Hillel Coren 2020-06-16 14:33:51 +03:00
parent e3051480be
commit 893d3be1ca
53 changed files with 175 additions and 177 deletions

View File

@ -165,6 +165,7 @@ class AuthRepository {
return serializers.deserializeWith(LoginResponse.serializer, response);
}
String get _tokenName =>
kIsWeb ? 'web_client' : Platform.isAndroid ? 'android_client' : 'ios_client';
String get _tokenName => kIsWeb
? 'web_client'
: Platform.isAndroid ? 'android_client' : 'ios_client';
}

View File

@ -50,6 +50,7 @@ final selectedIdReducer = combineReducers<String>([
return action.client.id;
}),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.client ? action.entityId : selectedId),
]);

View File

@ -22,6 +22,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddCompanyGatewaySuccess>(
(String selectedId, action) => action.companyGateway.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<CompanyGatewayEntity>([

View File

@ -38,6 +38,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ShowEmailCredit>(
(selectedId, action) => action.credit.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<InvoiceEntity>([

View File

@ -21,6 +21,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddDesignSuccess>(
(String selectedId, dynamic action) => action.design.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<DesignEntity>([

View File

@ -20,6 +20,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddDocumentSuccess>(
(selectedId, action) => action.document.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<DocumentEntity>([

View File

@ -20,6 +20,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddExpenseSuccess>(
(selectedId, action) => action.expense.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<ExpenseEntity>([
@ -315,5 +316,5 @@ ExpenseState _setLoadedExpenses(
expenseState.loadExpenses(action.expenses);
ExpenseState _setLoadedCompany(
ExpenseState expenseState, LoadCompanySuccess action) =>
ExpenseState expenseState, LoadCompanySuccess action) =>
expenseState.loadExpenses(action.userCompany.company.expenses);

View File

@ -22,6 +22,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddGroupSuccess>(
(String selectedId, action) => action.group.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.group ? action.entityId : selectedId),
]);

View File

@ -43,21 +43,23 @@ List<String> dropdownInvoiceSelector(
return list;
}
var memoizedFilteredInvoiceList = memo5(
(BuiltMap<String, InvoiceEntity> invoiceMap,
BuiltList<String> invoiceList,
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
ListUIState invoiceListState,) =>
filteredInvoicesSelector(invoiceMap, invoiceList, clientMap, paymentMap,
invoiceListState));
var memoizedFilteredInvoiceList = memo5((
BuiltMap<String, InvoiceEntity> invoiceMap,
BuiltList<String> invoiceList,
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
ListUIState invoiceListState,
) =>
filteredInvoicesSelector(
invoiceMap, invoiceList, clientMap, paymentMap, invoiceListState));
List<String> filteredInvoicesSelector(
BuiltMap<String, InvoiceEntity> invoiceMap,
BuiltList<String> invoiceList,
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
ListUIState invoiceListState,) {
BuiltMap<String, InvoiceEntity> invoiceMap,
BuiltList<String> invoiceList,
BuiltMap<String, ClientEntity> clientMap,
BuiltMap<String, PaymentEntity> paymentMap,
ListUIState invoiceListState,
) {
final Map<String, List<String>> invoicePaymentMap = {};
if (invoiceListState.filterEntityType == EntityType.payment) {

View File

@ -20,6 +20,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddPaymentSuccess>(
(selectedId, action) => action.payment.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.payment ? action.entityId : selectedId),
]);

View File

@ -21,6 +21,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddPaymentTermSuccess>(
(String selectedId, dynamic action) => action.paymentTerm.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<PaymentTermEntity>([
@ -64,8 +65,7 @@ final paymentTermListReducer = combineReducers<ListUIState>([
_filterPaymentTermsByCustom1),
TypedReducer<ListUIState, FilterPaymentTermsByCustom2>(
_filterPaymentTermsByCustom2),
TypedReducer<ListUIState, FilterByEntity>(
_filterPaymentTermsByClient),
TypedReducer<ListUIState, FilterByEntity>(_filterPaymentTermsByClient),
TypedReducer<ListUIState, StartPaymentTermMultiselect>(_startListMultiselect),
TypedReducer<ListUIState, AddToPaymentTermMultiselect>(_addToListMultiselect),
TypedReducer<ListUIState, RemoveFromPaymentTermMultiselect>(

View File

@ -57,6 +57,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddProductSuccess>(
(selectedId, action) => action.product.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final productListReducer = combineReducers<ListUIState>([

View File

@ -36,6 +36,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddProjectSuccess>(
(selectedId, action) => action.project.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<ProjectEntity>([

View File

@ -37,6 +37,7 @@ Reducer<String> selectedIdReducer = combineReducers([
(selectedId, action) => action.quote.id),
TypedReducer<String, ShowEmailQuote>((selectedId, action) => action.quote.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<InvoiceEntity>([

View File

@ -29,6 +29,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, ViewTask>((selectedId, action) => action.taskId),
TypedReducer<String, AddTaskSuccess>((selectedId, action) => action.task.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<TaskEntity>([
@ -296,6 +297,5 @@ TaskState _setLoadedTask(TaskState taskState, LoadTaskSuccess action) {
TaskState _setLoadedTasks(TaskState taskState, LoadTasksSuccess action) =>
taskState.loadTasks(action.tasks);
TaskState _setLoadedCompany(
TaskState taskState, LoadCompanySuccess action) =>
TaskState _setLoadedCompany(TaskState taskState, LoadCompanySuccess action) =>
taskState.loadTasks(action.userCompany.company.tasks);

View File

@ -21,6 +21,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddTaxRateSuccess>(
(String selectedId, action) => action.taxRate.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<TaxRateEntity>([

View File

@ -21,14 +21,10 @@ import 'package:invoiceninja_flutter/redux/project/project_reducer.dart';
import 'package:invoiceninja_flutter/redux/quote/quote_reducer.dart';
import 'package:invoiceninja_flutter/redux/task/task_reducer.dart';
import 'package:invoiceninja_flutter/redux/vendor/vendor_reducer.dart';
// STARTER: import - do not remove comment
import 'package:invoiceninja_flutter/redux/payment_term/payment_term_reducer.dart';
import 'package:invoiceninja_flutter/redux/design/design_reducer.dart';
import 'package:invoiceninja_flutter/redux/credit/credit_reducer.dart';
import 'package:invoiceninja_flutter/redux/user/user_reducer.dart';
import 'package:invoiceninja_flutter/redux/tax_rate/tax_rate_reducer.dart';
import 'package:invoiceninja_flutter/redux/company_gateway/company_gateway_reducer.dart';

View File

@ -20,6 +20,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddUserSuccess>(
(String selectedId, action) => action.user.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
TypedReducer<String, FilterByEntity>((selectedId, action) =>
action.entityType == EntityType.user ? action.entityId : selectedId),
]);

View File

@ -48,6 +48,7 @@ Reducer<String> selectedIdReducer = combineReducers([
TypedReducer<String, AddVendorSuccess>(
(selectedId, action) => action.vendor.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<VendorEntity>([

View File

@ -83,7 +83,6 @@ class ViewActionMenuButton extends StatelessWidget {
entity: entity,
onSelected: onSelected,
isSaving: isSaving,
entityActions: entityActions
);
entityActions: entityActions);
}
}

View File

@ -42,7 +42,8 @@ class ActivityListTile extends StatelessWidget {
onTap: !enableNavigation
? null
: () {
print('## ON TAP: ${activity.entityType} - ${activity.invoiceId}');
print(
'## ON TAP: ${activity.entityType} - ${activity.invoiceId}');
switch (activity.entityType) {
case EntityType.task:
viewEntityById(

View File

@ -81,8 +81,7 @@ class CompanyGatewayListVM {
isLoading: state.isLoading,
isLoaded: state.companyGatewayState.isLoaded,
filter: state.companyGatewayUIState.listUIState.filter,
onClearEntityFilterPressed: () =>
store.dispatch(ClearEntityFilter()),
onClearEntityFilterPressed: () => store.dispatch(ClearEntityFilter()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.companyGatewayListState.filterEntityId,

View File

@ -225,7 +225,9 @@ class CreditListItem extends StatelessWidget {
localization
.lookup(kCreditStatuses[credit.statusId]),
style: TextStyle(
color: !credit.isSent ? textColor : CreditStatusColors.colors[credit.statusId],
color: !credit.isSent
? textColor
: CreditStatusColors.colors[credit.statusId],
)),
],
),

View File

@ -124,22 +124,22 @@ class CreditScreen extends StatelessWidget {
onSelectedCustom4: (value) =>
store.dispatch(FilterCreditsByCustom4(value)),
),
floatingActionButton:
state.prefState.isMenuFloated && 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,
)
: null,
floatingActionButton: state.prefState.isMenuFloated &&
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,
)
: null,
);
}
}

View File

@ -3,11 +3,8 @@ import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
class DesignPresenter extends EntityPresenter {
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
return [
];
return [];
}
static List<String> getAllTableFields(UserCompanyEntity userCompany) {

View File

@ -119,8 +119,7 @@ class DocumentListVM {
isLoading: state.isLoading,
isLoaded: state.documentState.isLoaded,
filter: state.documentUIState.listUIState.filter,
onClearEntityFilterPressed: () =>
store.dispatch(FilterByEntity()),
onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.documentListState.filterEntityId,

View File

@ -110,22 +110,22 @@ class DocumentScreen extends StatelessWidget {
}
},
),
floatingActionButton:
state.prefState.isMenuFloated && userCompany.canCreate(EntityType.document)
? FloatingActionButton(
heroTag: 'document_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.document);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newDocument,
)
: null,
floatingActionButton: state.prefState.isMenuFloated &&
userCompany.canCreate(EntityType.document)
? FloatingActionButton(
heroTag: 'document_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.document);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newDocument,
)
: null,
);
}
}

View File

@ -135,8 +135,7 @@ class ExpenseListVM {
isLoading: state.isLoading,
isLoaded: state.expenseState.isLoaded,
filter: state.expenseUIState.listUIState.filter,
onClearEntityFilterPressed: () =>
store.dispatch(FilterByEntity()),
onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.expenseListState.filterEntityId,

View File

@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
class ExpensePresenter extends EntityPresenter {
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
return [
ExpenseFields.vendor,

View File

@ -88,7 +88,8 @@ class ExpenseScreen extends StatelessWidget {
bottomNavigationBar: AppBottomBar(
entityType: EntityType.expense,
tableColumns: ExpensePresenter.getAllTableFields(userCompany),
defaultTableColumns: ExpensePresenter.getDefaultTableFields(userCompany),
defaultTableColumns:
ExpensePresenter.getDefaultTableFields(userCompany),
onRefreshPressed: () => store.dispatch(LoadExpenses(force: true)),
onSelectedSortField: (value) => store.dispatch(SortExpenses(value)),
customValues1: company.getCustomFieldValues(CustomFieldType.expense1,

View File

@ -82,7 +82,6 @@ class InvoiceEditItemsVM extends EntityEditItemsVM {
);
factory InvoiceEditItemsVM.fromStore(Store<AppState> store) {
return InvoiceEditItemsVM(
state: store.state,
company: store.state.company,

View File

@ -248,7 +248,8 @@ class InvoiceListItem extends StatelessWidget {
),
Text(statusLabel,
style: TextStyle(
color: !invoice.isSent ? textColor : statusColor,
color:
!invoice.isSent ? textColor : statusColor,
)),
],
),

View File

@ -186,11 +186,11 @@ class InvoiceListVM extends EntityListVM {
user: state.user,
listState: state.invoiceListState,
invoiceList: memoizedFilteredInvoiceList(
state.invoiceState.map,
state.invoiceState.list,
state.clientState.map,
state.paymentState.map,
state.invoiceListState,
state.invoiceState.map,
state.invoiceState.list,
state.clientState.map,
state.paymentState.map,
state.invoiceListState,
),
invoiceMap: state.invoiceState.map,
clientMap: state.clientState.map,
@ -206,8 +206,7 @@ class InvoiceListVM extends EntityListVM {
}
},
onRefreshed: (context) => _handleRefresh(context),
onClearEntityFilterPressed: () =>
store.dispatch(FilterByEntity()),
onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.invoiceListState.filterEntityId,

View File

@ -88,7 +88,8 @@ class InvoiceScreen extends StatelessWidget {
bottomNavigationBar: AppBottomBar(
entityType: EntityType.invoice,
tableColumns: InvoicePresenter.getAllTableFields(userCompany),
defaultTableColumns: InvoicePresenter.getDefaultTableFields(userCompany),
defaultTableColumns:
InvoicePresenter.getDefaultTableFields(userCompany),
onRefreshPressed: () => store.dispatch(LoadInvoices(force: true)),
onSelectedSortField: (value) {
store.dispatch(SortInvoices(value));

View File

@ -139,8 +139,7 @@ class PaymentListVM {
viewEntity(context: context, entity: payment);
}
},
onClearEntityFilterPressed: () =>
store.dispatch(FilterByEntity()),
onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.paymentListState.filterEntityId,

View File

@ -84,7 +84,8 @@ class PaymentScreen extends StatelessWidget {
bottomNavigationBar: AppBottomBar(
entityType: EntityType.payment,
tableColumns: PaymentPresenter.getAllTableFields(userCompany),
defaultTableColumns: PaymentPresenter.getDefaultTableFields(userCompany),
defaultTableColumns:
PaymentPresenter.getDefaultTableFields(userCompany),
onRefreshPressed: () => store.dispatch(LoadPayments(force: true)),
onSelectedSortField: (value) => store.dispatch(SortPayments(value)),
customValues1: company.getCustomFieldValues(CustomFieldType.payment1,

View File

@ -125,8 +125,7 @@ class PaymentTermListVM {
isLoading: state.isLoading,
isLoaded: state.paymentTermState.isLoaded,
filter: state.paymentTermUIState.listUIState.filter,
onClearEntityFilterPressed: () =>
store.dispatch(FilterByEntity()),
onClearEntityFilterPressed: () => store.dispatch(FilterByEntity()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.paymentTermListState.filterEntityId,

View File

@ -3,11 +3,8 @@ import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
class PaymentTermPresenter extends EntityPresenter {
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
return [
];
return [];
}
static List<String> getAllTableFields(UserCompanyEntity userCompany) {

View File

@ -84,7 +84,8 @@ class ProductScreen extends StatelessWidget {
bottomNavigationBar: AppBottomBar(
entityType: EntityType.product,
tableColumns: ProductPresenter.getAllTableFields(userCompany),
defaultTableColumns: ProductPresenter.getDefaultTableFields(userCompany),
defaultTableColumns:
ProductPresenter.getDefaultTableFields(userCompany),
onRefreshPressed: () => store.dispatch(LoadProducts(force: true)),
onSelectedSortField: (value) => store.dispatch(SortProducts(value)),
customValues1: company.getCustomFieldValues(CustomFieldType.product1,
@ -119,22 +120,22 @@ class ProductScreen extends StatelessWidget {
}
},
),
floatingActionButton:
state.prefState.isMenuFloated && userCompany.canCreate(EntityType.product)
? FloatingActionButton(
heroTag: 'product_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.product);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newProduct,
)
: null,
floatingActionButton: state.prefState.isMenuFloated &&
userCompany.canCreate(EntityType.product)
? FloatingActionButton(
heroTag: 'product_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.product);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newProduct,
)
: null,
);
}
}

View File

@ -129,8 +129,7 @@ class ProjectListVM {
isLoading: state.isLoading,
isLoaded: state.projectState.isLoaded,
filter: state.projectUIState.listUIState.filter,
onClearEntityFilterPressed: () =>
store.dispatch(ClearEntityFilter()),
onClearEntityFilterPressed: () => store.dispatch(ClearEntityFilter()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.projectListState.filterEntityId,

View File

@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
import 'package:invoiceninja_flutter/utils/formatting.dart';
class ProjectPresenter extends EntityPresenter {
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
return [
ProjectFields.name,

View File

@ -86,7 +86,8 @@ class ProjectScreen extends StatelessWidget {
bottomNavigationBar: AppBottomBar(
entityType: EntityType.project,
tableColumns: ProjectPresenter.getAllTableFields(userCompany),
defaultTableColumns: ProjectPresenter.getDefaultTableFields(userCompany),
defaultTableColumns:
ProjectPresenter.getDefaultTableFields(userCompany),
onRefreshPressed: () => store.dispatch(LoadProjects(force: true)),
onSelectedSortField: (value) => store.dispatch(SortProjects(value)),
customValues1: company.getCustomFieldValues(CustomFieldType.project1,
@ -120,20 +121,20 @@ class ProjectScreen extends StatelessWidget {
}
},
),
floatingActionButton:
state.prefState.isMenuFloated && userCompany.canCreate(EntityType.project)
? FloatingActionButton(
heroTag: 'project_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () => createEntityByType(
context: context, entityType: EntityType.project),
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newProject,
)
: null,
floatingActionButton: state.prefState.isMenuFloated &&
userCompany.canCreate(EntityType.project)
? FloatingActionButton(
heroTag: 'project_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () => createEntityByType(
context: context, entityType: EntityType.project),
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newProject,
)
: null,
);
}
}

View File

@ -149,22 +149,22 @@ class QuoteScreen extends StatelessWidget {
}
},
),
floatingActionButton:
state.prefState.isMenuFloated && userCompany.canCreate(EntityType.quote)
? FloatingActionButton(
heroTag: 'quote_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.quote);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newQuote,
)
: null,
floatingActionButton: state.prefState.isMenuFloated &&
userCompany.canCreate(EntityType.quote)
? FloatingActionButton(
heroTag: 'quote_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.quote);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newQuote,
)
: null,
);
}
}

View File

@ -170,7 +170,8 @@ class _AccountOverview extends StatelessWidget {
callback: (value) {
final state = viewModel.state;
final credentials = state.credentials;
final url = '${credentials.url}/claim_license?license_key=$value';
final url =
'${credentials.url}/claim_license?license_key=$value';
WebClient()
.post(
url,

View File

@ -6,7 +6,6 @@ import 'package:invoiceninja_flutter/redux/app/app_state.dart';
import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
class TaskPresenter extends EntityPresenter {
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
return [
TaskFields.client,

View File

@ -120,8 +120,7 @@ class TaxRateListVM {
isLoading: state.isLoading,
isLoaded: state.taxRateState.isLoaded,
filter: state.taxRateUIState.listUIState.filter,
onClearEntityFilterPressed: () =>
store.dispatch(ClearEntityFilter()),
onClearEntityFilterPressed: () => store.dispatch(ClearEntityFilter()),
onViewEntityFilterPressed: (BuildContext context) => viewEntityById(
context: context,
entityId: state.taxRateListState.filterEntityId,

View File

@ -3,7 +3,6 @@ import 'package:invoiceninja_flutter/data/models/models.dart';
import 'package:invoiceninja_flutter/ui/app/presenters/entity_presenter.dart';
class VendorPresenter extends EntityPresenter {
static List<String> getDefaultTableFields(UserCompanyEntity userCompany) {
return [
VendorFields.name,

View File

@ -120,22 +120,22 @@ class VendorScreen extends StatelessWidget {
}
},
),
floatingActionButton:
state.prefState.isMenuFloated && userCompany.canCreate(EntityType.vendor)
? FloatingActionButton(
heroTag: 'vendor_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.vendor);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newVendor,
)
: null,
floatingActionButton: state.prefState.isMenuFloated &&
userCompany.canCreate(EntityType.vendor)
? FloatingActionButton(
heroTag: 'vendor_fab',
backgroundColor: Theme.of(context).primaryColorDark,
onPressed: () {
createEntityByType(
context: context, entityType: EntityType.vendor);
},
child: Icon(
Icons.add,
color: Colors.white,
),
tooltip: localization.newVendor,
)
: null,
);
}
}

View File

@ -37,7 +37,6 @@ Completer<T> snackBarCompleter<T>(BuildContext context, String message,
//
}
completer.future.then((_) {
if (shouldPop) {
Navigator.of(context).pop();
@ -45,8 +44,8 @@ Completer<T> snackBarCompleter<T>(BuildContext context, String message,
if (scaffold != null) {
scaffold.showSnackBar(SnackBar(
content: SnackBarRow(
message: message,
)));
message: message,
)));
}
}).catchError((Object error) {
if (shouldPop) {

View File

@ -3891,20 +3891,16 @@ mixin LocalizationsProvider on LocaleCodeAware {
String get reminderEndless =>
_localizedValues[localeCode]['reminder_endless'] ?? '';
String get useDefault =>
_localizedValues[localeCode]['use_default'] ?? '';
String get useDefault => _localizedValues[localeCode]['use_default'] ?? '';
String get contactName =>
_localizedValues[localeCode]['contact_name'] ?? '';
String get contactName => _localizedValues[localeCode]['contact_name'] ?? '';
String get creditRemaining =>
_localizedValues[localeCode]['credit_remaining'] ?? '';
String get allRecords =>
_localizedValues[localeCode]['all_records'] ?? '';
String get allRecords => _localizedValues[localeCode]['all_records'] ?? '';
String get ownedByUser =>
_localizedValues[localeCode]['owned_by_user'] ?? '';
String get ownedByUser => _localizedValues[localeCode]['owned_by_user'] ?? '';
String lookup(String key) {
final lookupKey = toSnakeCase(key);

View File

@ -40,7 +40,6 @@ String getAppURL(BuildContext context) {
}
}
AppLayout calculateLayout(BuildContext context) {
final size = MediaQuery.of(context).size.width;

View File

@ -22,7 +22,8 @@ Reducer<String> selectedIdReducer = combineReducers([
(String selectedId, dynamic action) => action.stubId),
TypedReducer<String, AddStubSuccess>(
(String selectedId, dynamic action) => action.stub.id),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, SelectCompany>((selectedId, action) => ''),
TypedReducer<String, ClearEntityFilter>((selectedId, action) => ''),
]);
final editingReducer = combineReducers<StubEntity>([