diff --git a/lib/ui/routes/TourRoute.dart b/lib/ui/routes/TourRoute.dart index ca6edfb..0d79c4f 100644 --- a/lib/ui/routes/TourRoute.dart +++ b/lib/ui/routes/TourRoute.dart @@ -40,11 +40,19 @@ class _TourRouteState extends State { await UsersHelper().getSingleWithThrow(userID(), forceDownload: true); } + void setStateKeepCurrentIndex(BuildContext cxt) async { + _defaultIndex = DefaultTabController.of(cxt).index; + await key.currentState.refresh(); + } + List get _list => [ FirstTourPane(), // Account image - AccountImageTourPane(user: currUser), + AccountImageTourPane( + user: currUser, + onUpdated: setStateKeepCurrentIndex, + ), // Notifications PresentationPane( diff --git a/lib/ui/widgets/tour/account_image_tour_pane.dart b/lib/ui/widgets/tour/account_image_tour_pane.dart index fcccb15..7c62041 100644 --- a/lib/ui/widgets/tour/account_image_tour_pane.dart +++ b/lib/ui/widgets/tour/account_image_tour_pane.dart @@ -6,8 +6,12 @@ import 'package:comunic/utils/intl_utils.dart'; import 'package:flutter/material.dart'; class AccountImageTourPane extends PresentationPane { - AccountImageTourPane({@required User user}) - : super( + final Function(BuildContext) onUpdated; + + AccountImageTourPane({ + @required User user, + @required this.onUpdated, + }) : super( iconWidget: AccountImageWidget(user: user, width: 50), title: tr("Account image"), text: tr( @@ -15,5 +19,6 @@ class AccountImageTourPane extends PresentationPane { actionTitle: tr("Upload an account image"), onActionTap: (ctx) async { await uploadNewAccountImage(ctx); + onUpdated(ctx); }); }