From d05f392aae5da7be521b61ede8fc43add7e2b2c7 Mon Sep 17 00:00:00 2001 From: Serhii Date: Tue, 8 Mar 2022 13:11:55 +0200 Subject: [PATCH] Added routing to the sync indicator (#288) * Added routing to the sync indicator * fixed format * fixed format * resolved issues --- lib/src/screens/dashboard/dashboard_page.dart | 4 +++- lib/src/screens/dashboard/widgets/sync_indicator.dart | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index 4be30173e..1b75afb91 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -60,7 +60,9 @@ class DashboardPage extends BasePage { @override Widget middle(BuildContext context) { - return SyncIndicator(dashboardViewModel: walletViewModel); + return SyncIndicator(dashboardViewModel: walletViewModel, + onTap: () => Navigator.of(context, rootNavigator: true) + .pushNamed(Routes.nodeList)); } @override diff --git a/lib/src/screens/dashboard/widgets/sync_indicator.dart b/lib/src/screens/dashboard/widgets/sync_indicator.dart index 18e751f80..4daa64591 100644 --- a/lib/src/screens/dashboard/widgets/sync_indicator.dart +++ b/lib/src/screens/dashboard/widgets/sync_indicator.dart @@ -1,15 +1,15 @@ import 'package:flutter/material.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/core/sync_status_title.dart'; -import 'package:cake_wallet/palette.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:cw_core/sync_status.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart'; class SyncIndicator extends StatelessWidget { - SyncIndicator({@required this.dashboardViewModel}); + SyncIndicator({@required this.dashboardViewModel,this.onTap}); final DashboardViewModel dashboardViewModel; + final Function() onTap; @override Widget build(BuildContext context) { @@ -27,6 +27,8 @@ class SyncIndicator extends StatelessWidget { return ClipRRect( borderRadius: BorderRadius.all(Radius.circular(15)), + child: GestureDetector( + onTap: onTap, child: Container( height: 30, width: syncIndicatorWidth, @@ -74,7 +76,7 @@ class SyncIndicator extends StatelessWidget { ], ), ), - ); + )); } ); }