Documents
This commit is contained in:
parent
1f9154adec
commit
73ce305ac6
|
|
@ -51,7 +51,7 @@ class _ClientViewState extends State<ClientView>
|
||||||
final state = widget.viewModel.state;
|
final state = widget.viewModel.state;
|
||||||
_controller = TabController(
|
_controller = TabController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
length: 6,
|
length: state.company.isModuleEnabled(EntityType.document) ? 6 : 5,
|
||||||
initialIndex: widget.isFilter ? 0 : state.clientUIState.tabIndex);
|
initialIndex: widget.isFilter ? 0 : state.clientUIState.tabIndex);
|
||||||
_controller.addListener(_onTabChanged);
|
_controller.addListener(_onTabChanged);
|
||||||
}
|
}
|
||||||
|
|
@ -85,6 +85,7 @@ class _ClientViewState extends State<ClientView>
|
||||||
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 company = viewModel.state.company;
|
||||||
final client = viewModel.client;
|
final client = viewModel.client;
|
||||||
final documents = client.documents;
|
final documents = client.documents;
|
||||||
|
|
||||||
|
|
@ -122,6 +123,7 @@ class _ClientViewState extends State<ClientView>
|
||||||
Tab(
|
Tab(
|
||||||
text: localization.details,
|
text: localization.details,
|
||||||
),
|
),
|
||||||
|
if (company.isModuleEnabled(EntityType.document))
|
||||||
Tab(
|
Tab(
|
||||||
text: documents.isEmpty
|
text: documents.isEmpty
|
||||||
? localization.documents
|
? localization.documents
|
||||||
|
|
|
||||||
|
|
@ -429,7 +429,7 @@ class _ClientViewFullwidthState extends State<ClientViewFullwidth>
|
||||||
bottom: kMobileDialogPadding,
|
bottom: kMobileDialogPadding,
|
||||||
left: kMobileDialogPadding / 2),
|
left: kMobileDialogPadding / 2),
|
||||||
child: DefaultTabController(
|
child: DefaultTabController(
|
||||||
length: 5,
|
length: company.isModuleEnabled(EntityType.document) ? 5 : 4,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: minHeight,
|
height: minHeight,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
@ -446,6 +446,7 @@ class _ClientViewFullwidthState extends State<ClientViewFullwidth>
|
||||||
text:
|
text:
|
||||||
'${localization.paymentMethods} (${tokenMap.keys.length})',
|
'${localization.paymentMethods} (${tokenMap.keys.length})',
|
||||||
),
|
),
|
||||||
|
if (company.isModuleEnabled(EntityType.document))
|
||||||
Tab(
|
Tab(
|
||||||
text: documents.isEmpty
|
text: documents.isEmpty
|
||||||
? localization.documents
|
? localization.documents
|
||||||
|
|
@ -498,8 +499,10 @@ class _ClientViewFullwidthState extends State<ClientViewFullwidth>
|
||||||
tokenMap: tokenMap,
|
tokenMap: tokenMap,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (company.isModuleEnabled(EntityType.document))
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => viewModel.onRefreshed(context),
|
onRefresh: () =>
|
||||||
|
viewModel.onRefreshed(context),
|
||||||
child: ClientViewDocuments(
|
child: ClientViewDocuments(
|
||||||
viewModel: viewModel,
|
viewModel: viewModel,
|
||||||
key: ValueKey(viewModel.client.id),
|
key: ValueKey(viewModel.client.id),
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ class _VendorViewState extends State<VendorView>
|
||||||
final state = widget.viewModel.state;
|
final state = widget.viewModel.state;
|
||||||
_controller = TabController(
|
_controller = TabController(
|
||||||
vsync: this,
|
vsync: this,
|
||||||
length: 4,
|
length: state.company.isModuleEnabled(EntityType.document) ? 4 : 3,
|
||||||
initialIndex: widget.isFilter ? 0 : state.vendorUIState.tabIndex);
|
initialIndex: widget.isFilter ? 0 : state.vendorUIState.tabIndex);
|
||||||
_controller.addListener(_onTabChanged);
|
_controller.addListener(_onTabChanged);
|
||||||
}
|
}
|
||||||
|
|
@ -83,6 +83,7 @@ class _VendorViewState extends State<VendorView>
|
||||||
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 company = viewModel.state.company;
|
||||||
final vendor = viewModel.vendor;
|
final vendor = viewModel.vendor;
|
||||||
final documents = vendor.documents;
|
final documents = vendor.documents;
|
||||||
|
|
||||||
|
|
@ -120,6 +121,7 @@ class _VendorViewState extends State<VendorView>
|
||||||
Tab(
|
Tab(
|
||||||
text: localization.details,
|
text: localization.details,
|
||||||
),
|
),
|
||||||
|
if (company.isModuleEnabled(EntityType.document))
|
||||||
Tab(
|
Tab(
|
||||||
text: documents.isEmpty
|
text: documents.isEmpty
|
||||||
? localization.documents
|
? localization.documents
|
||||||
|
|
@ -148,6 +150,7 @@ class _VendorViewState extends State<VendorView>
|
||||||
onRefresh: () => viewModel.onRefreshed(context),
|
onRefresh: () => viewModel.onRefreshed(context),
|
||||||
child: VendorViewDetails(vendor: viewModel.vendor),
|
child: VendorViewDetails(vendor: viewModel.vendor),
|
||||||
),
|
),
|
||||||
|
if (company.isModuleEnabled(EntityType.document))
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => viewModel.onRefreshed(context),
|
onRefresh: () => viewModel.onRefreshed(context),
|
||||||
child: VendorViewDocuments(
|
child: VendorViewDocuments(
|
||||||
|
|
|
||||||
|
|
@ -335,7 +335,7 @@ class _VendorViewFullwidthState extends State<VendorViewFullwidth>
|
||||||
bottom: kMobileDialogPadding,
|
bottom: kMobileDialogPadding,
|
||||||
left: kMobileDialogPadding / 2),
|
left: kMobileDialogPadding / 2),
|
||||||
child: DefaultTabController(
|
child: DefaultTabController(
|
||||||
length: 3,
|
length: company.isModuleEnabled(EntityType.document) ? 3 : 2,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: minHeight,
|
height: minHeight,
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
@ -347,6 +347,7 @@ class _VendorViewFullwidthState extends State<VendorViewFullwidth>
|
||||||
Tab(
|
Tab(
|
||||||
child: Text(localization.standing),
|
child: Text(localization.standing),
|
||||||
),
|
),
|
||||||
|
if (company.isModuleEnabled(EntityType.document))
|
||||||
Tab(
|
Tab(
|
||||||
text: documents.isEmpty
|
text: documents.isEmpty
|
||||||
? localization.documents
|
? localization.documents
|
||||||
|
|
@ -383,8 +384,10 @@ class _VendorViewFullwidthState extends State<VendorViewFullwidth>
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
if (company.isModuleEnabled(EntityType.document))
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
onRefresh: () => viewModel.onRefreshed(context),
|
onRefresh: () =>
|
||||||
|
viewModel.onRefreshed(context),
|
||||||
child: VendorViewDocuments(
|
child: VendorViewDocuments(
|
||||||
viewModel: viewModel,
|
viewModel: viewModel,
|
||||||
key: ValueKey(viewModel.vendor.id),
|
key: ValueKey(viewModel.vendor.id),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue