Fix pull to refresh
This commit is contained in:
parent
fd0057a33c
commit
b65cb1590c
|
|
@ -69,7 +69,8 @@ class _ClientViewState extends State<ClientView>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Builder(builder: (context) {
|
||||||
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
|
|
@ -102,7 +103,8 @@ class _ClientViewState extends State<ClientView>
|
||||||
action2: EntityAction.newInvoice,
|
action2: EntityAction.newInvoice,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
|
}),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
heroTag: 'client_view_fab',
|
heroTag: 'client_view_fab',
|
||||||
backgroundColor: Theme.of(context).primaryColorDark,
|
backgroundColor: Theme.of(context).primaryColorDark,
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,8 @@ class _ExpenseViewState extends State<ExpenseView>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: TabBarView(
|
body: Builder(builder: (context) {
|
||||||
|
return TabBarView(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
|
|
@ -85,7 +86,8 @@ class _ExpenseViewState extends State<ExpenseView>
|
||||||
viewModel: viewModel, expense: viewModel.expense),
|
viewModel: viewModel, expense: viewModel.expense),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
|
}),
|
||||||
floatingActionButton: company.isEnterprisePlan
|
floatingActionButton: company.isEnterprisePlan
|
||||||
? Builder(builder: (BuildContext context) {
|
? Builder(builder: (BuildContext context) {
|
||||||
return FloatingActionButton(
|
return FloatingActionButton(
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,8 @@ class _VendorViewState extends State<VendorView>
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: TabBarView(
|
body: Builder(builder: (context) {
|
||||||
|
return TabBarView(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
RefreshIndicator(
|
RefreshIndicator(
|
||||||
|
|
@ -68,7 +69,8 @@ class _VendorViewState extends State<VendorView>
|
||||||
child: VendorViewDetails(vendor: viewModel.vendor),
|
child: VendorViewDetails(vendor: viewModel.vendor),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
);
|
||||||
|
}),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
heroTag: 'vendor_view_fab',
|
heroTag: 'vendor_view_fab',
|
||||||
backgroundColor: Theme.of(context).primaryColorDark,
|
backgroundColor: Theme.of(context).primaryColorDark,
|
||||||
|
|
|
||||||
|
|
@ -29,12 +29,13 @@ Completer<Null> refreshCompleter(BuildContext context) {
|
||||||
Completer<T> snackBarCompleter<T>(BuildContext context, String message,
|
Completer<T> snackBarCompleter<T>(BuildContext context, String message,
|
||||||
{bool shouldPop = false}) {
|
{bool shouldPop = false}) {
|
||||||
final Completer<T> completer = Completer<T>();
|
final Completer<T> completer = Completer<T>();
|
||||||
|
final scaffold = Scaffold.of(context);
|
||||||
|
|
||||||
completer.future.then((_) {
|
completer.future.then((_) {
|
||||||
if (shouldPop) {
|
if (shouldPop) {
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}
|
}
|
||||||
Scaffold.of(context).showSnackBar(SnackBar(
|
scaffold.showSnackBar(SnackBar(
|
||||||
content: SnackBarRow(
|
content: SnackBarRow(
|
||||||
message: message,
|
message: message,
|
||||||
)));
|
)));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue