Added routing to the sync indicator (#288)

* Added routing to the sync indicator

* fixed format

* fixed format

* resolved issues
This commit is contained in:
Serhii 2022-03-08 13:11:55 +02:00 committed by GitHub
parent 12c5ed27dc
commit d05f392aae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -60,7 +60,9 @@ class DashboardPage extends BasePage {
@override @override
Widget middle(BuildContext context) { Widget middle(BuildContext context) {
return SyncIndicator(dashboardViewModel: walletViewModel); return SyncIndicator(dashboardViewModel: walletViewModel,
onTap: () => Navigator.of(context, rootNavigator: true)
.pushNamed(Routes.nodeList));
} }
@override @override

View file

@ -1,15 +1,15 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.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/core/sync_status_title.dart';
import 'package:cake_wallet/palette.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cw_core/sync_status.dart'; import 'package:cw_core/sync_status.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator_icon.dart';
class SyncIndicator extends StatelessWidget { class SyncIndicator extends StatelessWidget {
SyncIndicator({@required this.dashboardViewModel}); SyncIndicator({@required this.dashboardViewModel,this.onTap});
final DashboardViewModel dashboardViewModel; final DashboardViewModel dashboardViewModel;
final Function() onTap;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -27,6 +27,8 @@ class SyncIndicator extends StatelessWidget {
return ClipRRect( return ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(15)), borderRadius: BorderRadius.all(Radius.circular(15)),
child: GestureDetector(
onTap: onTap,
child: Container( child: Container(
height: 30, height: 30,
width: syncIndicatorWidth, width: syncIndicatorWidth,
@ -74,7 +76,7 @@ class SyncIndicator extends StatelessWidget {
], ],
), ),
), ),
); ));
} }
); );
} }