mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-31 06:55:59 +00:00
pull to refresh (#1389)
This commit is contained in:
parent
fb9534a0e9
commit
a0820e8a73
2 changed files with 20 additions and 5 deletions
|
@ -51,14 +51,25 @@ class DashboardPage extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final screenHeight = MediaQuery.of(context).size.height;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Observer(
|
body: Observer(
|
||||||
builder: (_) {
|
builder: (_) {
|
||||||
final dashboardPageView = _DashboardPageView(
|
final dashboardPageView = RefreshIndicator(
|
||||||
balancePage: balancePage,
|
displacement: screenHeight * 0.1,
|
||||||
bottomSheetService: bottomSheetService,
|
onRefresh: () async => await dashboardViewModel.refreshDashboard(),
|
||||||
dashboardViewModel: dashboardViewModel,
|
child: SingleChildScrollView(
|
||||||
addressListViewModel: addressListViewModel,
|
physics: AlwaysScrollableScrollPhysics(),
|
||||||
|
child: Container(
|
||||||
|
height: screenHeight,
|
||||||
|
child: _DashboardPageView(
|
||||||
|
balancePage: balancePage,
|
||||||
|
bottomSheetService: bottomSheetService,
|
||||||
|
dashboardViewModel: dashboardViewModel,
|
||||||
|
addressListViewModel: addressListViewModel,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DeviceInfo.instance.isDesktop) {
|
if (DeviceInfo.instance.isDesktop) {
|
||||||
|
|
|
@ -547,4 +547,8 @@ abstract class DashboardViewModelBase with Store {
|
||||||
return ServicesResponse([], false, '');
|
return ServicesResponse([], false, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> refreshDashboard() async {
|
||||||
|
reconnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue