Tablet layout
This commit is contained in:
parent
efb77a0193
commit
cb9da60103
|
|
@ -1,23 +1,28 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/app/app_state.dart';
|
||||
import 'package:invoiceninja_flutter/redux/dashboard/dashboard_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/ui_state.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_bottom_bar.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
|
||||
import 'app_drawer_vm.dart';
|
||||
|
||||
class AppScaffold extends StatelessWidget {
|
||||
const AppScaffold(
|
||||
{@required this.appBar,
|
||||
const AppScaffold({@required this.appBarTitle,
|
||||
@required this.appBarActions,
|
||||
@required this.body,
|
||||
@required this.bottomNavigationBar,
|
||||
@required this.floatingActionButton});
|
||||
|
||||
final AppBar appBar;
|
||||
final Widget body;
|
||||
final AppBottomBar bottomNavigationBar;
|
||||
final FloatingActionButton floatingActionButton;
|
||||
|
||||
final Widget appBarTitle;
|
||||
final List<Widget> appBarActions;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final store = StoreProvider.of<AppState>(context);
|
||||
|
|
@ -29,7 +34,17 @@ class AppScaffold extends StatelessWidget {
|
|||
},
|
||||
child: Scaffold(
|
||||
drawer: AppDrawerBuilder(),
|
||||
appBar: appBar,
|
||||
appBar: AppBar(
|
||||
leading: !isMobile(context)
|
||||
? IconButton(
|
||||
icon: Icon(Icons.menu),
|
||||
onPressed: () =>
|
||||
store.dispatch(UpdateSidebar(AppSidebar.menu)),
|
||||
)
|
||||
: null,
|
||||
title: appBarTitle,
|
||||
actions: appBarActions,
|
||||
),
|
||||
body: body,
|
||||
bottomNavigationBar: bottomNavigationBar,
|
||||
floatingActionButton: floatingActionButton,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import 'package:invoiceninja_flutter/redux/app/app_actions.dart';
|
||||
import 'package:invoiceninja_flutter/redux/ui/ui_state.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_scaffold.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/list_filter_button.dart';
|
||||
|
|
@ -12,7 +10,6 @@ import 'package:invoiceninja_flutter/ui/client/client_list_vm.dart';
|
|||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:invoiceninja_flutter/redux/client/client_actions.dart';
|
||||
import 'package:invoiceninja_flutter/ui/app/app_bottom_bar.dart';
|
||||
import 'package:invoiceninja_flutter/utils/platforms.dart';
|
||||
|
||||
class ClientScreen extends StatelessWidget {
|
||||
static const String route = '/client';
|
||||
|
|
@ -26,21 +23,14 @@ class ClientScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
leading: !isMobile(context)
|
||||
? IconButton(
|
||||
icon: Icon(Icons.menu),
|
||||
onPressed: () => store.dispatch(UpdateSidebar(AppSidebar.menu)),
|
||||
)
|
||||
: null,
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(state.clientListState.filterClearedAt),
|
||||
entityType: EntityType.client,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterClients(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.client,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -48,7 +38,6 @@ class ClientScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ClientListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.client,
|
||||
|
|
|
|||
|
|
@ -22,15 +22,14 @@ class DocumentScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(state.documentListState.filterClearedAt),
|
||||
entityType: EntityType.document,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterDocuments(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.document,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -38,7 +37,6 @@ class DocumentScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: DocumentListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.document,
|
||||
|
|
|
|||
|
|
@ -22,15 +22,14 @@ class ExpenseScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.expenseListState.filterClearedAt),
|
||||
entityType: EntityType.expense,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterExpenses(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.expense,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -38,7 +37,6 @@ class ExpenseScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ExpenseListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.expense,
|
||||
|
|
|
|||
|
|
@ -21,15 +21,14 @@ class InvoiceScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.invoiceListState.filterClearedAt),
|
||||
entityType: EntityType.invoice,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterInvoices(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.invoice,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -37,7 +36,6 @@ class InvoiceScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: InvoiceListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.invoice,
|
||||
|
|
|
|||
|
|
@ -19,15 +19,14 @@ class PaymentScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.paymentListState.filterClearedAt),
|
||||
entityType: EntityType.payment,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterPayments(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.payment,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -35,7 +34,6 @@ class PaymentScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: PaymentListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.payment,
|
||||
|
|
|
|||
|
|
@ -22,15 +22,14 @@ class ProductScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.productListState.filterClearedAt),
|
||||
entityType: EntityType.product,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterProducts(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.product,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -38,7 +37,6 @@ class ProductScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ProductListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.product,
|
||||
|
|
|
|||
|
|
@ -21,15 +21,14 @@ class ProjectScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.projectListState.filterClearedAt),
|
||||
entityType: EntityType.project,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterProjects(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.project,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -37,7 +36,6 @@ class ProjectScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ProjectListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.project,
|
||||
|
|
|
|||
|
|
@ -21,15 +21,14 @@ class QuoteScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.quoteListState.filterClearedAt),
|
||||
entityType: EntityType.quote,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterQuotes(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.quote,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -37,7 +36,6 @@ class QuoteScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: QuoteListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.quote,
|
||||
|
|
|
|||
|
|
@ -22,15 +22,14 @@ class TaskScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.taskListState.filterClearedAt),
|
||||
entityType: EntityType.task,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterTasks(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.task,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -38,7 +37,6 @@ class TaskScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: TaskListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.task,
|
||||
|
|
|
|||
|
|
@ -21,15 +21,14 @@ class VendorScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(store.state.vendorListState.filterClearedAt),
|
||||
entityType: EntityType.vendor,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterVendors(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.vendor,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -37,7 +36,6 @@ class VendorScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: VendorListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.vendor,
|
||||
|
|
|
|||
|
|
@ -24,15 +24,14 @@ class StubScreen extends StatelessWidget {
|
|||
final localization = AppLocalization.of(context);
|
||||
|
||||
return AppScaffold(
|
||||
appBar: AppBar(
|
||||
title: ListFilter(
|
||||
appBarTitle: ListFilter(
|
||||
key: ValueKey(state.stubListState.filterClearedAt),
|
||||
entityType: EntityType.stub,
|
||||
onFilterChanged: (value) {
|
||||
store.dispatch(FilterStubs(value));
|
||||
},
|
||||
),
|
||||
actions: [
|
||||
appBarActions: [
|
||||
ListFilterButton(
|
||||
entityType: EntityType.stub,
|
||||
onFilterPressed: (String value) {
|
||||
|
|
@ -40,7 +39,6 @@ class StubScreen extends StatelessWidget {
|
|||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: StubListBuilder(),
|
||||
bottomNavigationBar: AppBottomBar(
|
||||
entityType: EntityType.stub,
|
||||
|
|
|
|||
Loading…
Reference in New Issue