Settings
This commit is contained in:
parent
a44a1c8826
commit
d4662be3a1
|
|
@ -289,7 +289,7 @@ abstract class AppState implements Built<AppState, AppStateBuilder> {
|
||||||
String toString() {
|
String toString() {
|
||||||
//return 'Settings: ${selectedCompanyState.company.settings}';
|
//return 'Settings: ${selectedCompanyState.company.settings}';
|
||||||
//return 'URL: ${authState.url}, ${selectedCompany.plan}';
|
//return 'URL: ${authState.url}, ${selectedCompany.plan}';
|
||||||
return 'Route: ${uiState.currentRoute}, updatedAt: ${settingsUIState.updatedAt}';
|
return 'Route: ${uiState.currentRoute}, size: ${selectedCompany.sizeId}/${uiState.settingsUIState.editing.company.sizeId}, country: ${selectedCompany.countryId}/${uiState.settingsUIState.editing.company.countryId} updatedAt: ${settingsUIState.updatedAt}';
|
||||||
//return 'Route: ${uiState.currentRoute}, Previous: ${uiState.previousRoute}, Layout: ${uiState.layout}, Menu: ${uiState.isMenuVisible}, History: ${uiState.isHistoryVisible}';
|
//return 'Route: ${uiState.currentRoute}, Previous: ${uiState.previousRoute}, Layout: ${uiState.layout}, Menu: ${uiState.isMenuVisible}, History: ${uiState.isHistoryVisible}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ class _InvoiceEditState extends State<InvoiceEdit>
|
||||||
body: Form(
|
body: Form(
|
||||||
key: widget.formKey,
|
key: widget.formKey,
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
key: ValueKey(viewModel.invoice.id),
|
key: ValueKey('__invoice_${viewModel.invoice.id}__'),
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
InvoiceEditDetailsScreen(),
|
InvoiceEditDetailsScreen(),
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:invoiceninja_flutter/data/models/entities.dart';
|
||||||
|
import 'package:invoiceninja_flutter/redux/static/static_selectors.dart';
|
||||||
|
import 'package:invoiceninja_flutter/ui/app/entity_dropdown.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
import 'package:invoiceninja_flutter/ui/app/form_card.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
import 'package:invoiceninja_flutter/ui/app/forms/decorated_form_field.dart';
|
||||||
import 'package:invoiceninja_flutter/ui/settings/company_details_vm.dart';
|
import 'package:invoiceninja_flutter/ui/settings/company_details_vm.dart';
|
||||||
|
|
@ -119,6 +122,8 @@ class _CompanyDetailsState extends State<CompanyDetails>
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
final viewModel = widget.viewModel;
|
final viewModel = widget.viewModel;
|
||||||
|
final state = viewModel.state;
|
||||||
|
final company = viewModel.company;
|
||||||
|
|
||||||
return SettingsScaffold(
|
return SettingsScaffold(
|
||||||
title: localization.companyDetails,
|
title: localization.companyDetails,
|
||||||
|
|
@ -176,7 +181,36 @@ class _CompanyDetailsState extends State<CompanyDetails>
|
||||||
controller: _phoneController,
|
controller: _phoneController,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
),
|
||||||
|
FormCard(
|
||||||
|
children: <Widget>[
|
||||||
|
EntityDropdown(
|
||||||
|
key: ValueKey('__size_${company.sizeId}__'),
|
||||||
|
entityType: EntityType.size,
|
||||||
|
entityMap: state.staticState.sizeMap,
|
||||||
|
entityList: memoizedSizeList(state.staticState.sizeMap),
|
||||||
|
labelText: localization.size,
|
||||||
|
initialValue:
|
||||||
|
state.staticState.sizeMap[company.sizeId]?.name,
|
||||||
|
onSelected: (SelectableEntity size) =>
|
||||||
|
viewModel.onChanged(
|
||||||
|
company.rebuild((b) => b..sizeId = size.id)),
|
||||||
|
),
|
||||||
|
EntityDropdown(
|
||||||
|
key: ValueKey('__industry_${company.industryId}__'),
|
||||||
|
entityType: EntityType.industry,
|
||||||
|
entityMap: state.staticState.industryMap,
|
||||||
|
entityList:
|
||||||
|
memoizedIndustryList(state.staticState.industryMap),
|
||||||
|
labelText: localization.industry,
|
||||||
|
initialValue: state
|
||||||
|
.staticState.industryMap[company.industryId]?.name,
|
||||||
|
onSelected: (SelectableEntity industry) =>
|
||||||
|
viewModel.onChanged(company
|
||||||
|
.rebuild((b) => b..industryId = industry.id)),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
ListView(
|
ListView(
|
||||||
|
|
@ -203,6 +237,19 @@ class _CompanyDetailsState extends State<CompanyDetails>
|
||||||
label: localization.postalCode,
|
label: localization.postalCode,
|
||||||
controller: _postalCodeController,
|
controller: _postalCodeController,
|
||||||
),
|
),
|
||||||
|
EntityDropdown(
|
||||||
|
key: ValueKey('__country_${company.countryId}__'),
|
||||||
|
entityType: EntityType.country,
|
||||||
|
entityMap: state.staticState.countryMap,
|
||||||
|
entityList:
|
||||||
|
memoizedCountryList(state.staticState.countryMap),
|
||||||
|
labelText: localization.country,
|
||||||
|
initialValue:
|
||||||
|
state.staticState.countryMap[company.countryId]?.name,
|
||||||
|
onSelected: (SelectableEntity country) =>
|
||||||
|
viewModel.onChanged(company
|
||||||
|
.rebuild((b) => b..countryId = country.id)),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ class CompanyDetailsVM {
|
||||||
|
|
||||||
return CompanyDetailsVM(
|
return CompanyDetailsVM(
|
||||||
state: state,
|
state: state,
|
||||||
company: state.selectedCompany,
|
company: state.uiState.settingsUIState.editing.company,
|
||||||
onChanged: (company) =>
|
onChanged: (company) =>
|
||||||
store.dispatch(UpdateCompanySettings(company: company)),
|
store.dispatch(UpdateCompanySettings(company: company)),
|
||||||
onCancelPressed: (context) => store
|
onCancelPressed: (context) => store
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue