From 60d46a3d7bc066c66d2ad2eecddf470d558c2ff9 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Tue, 13 Aug 2024 09:16:23 +0200 Subject: [PATCH] fix(neon_framework): Fix active account propagation for account settings and tile Signed-off-by: provokateurin --- .../neon_framework/lib/src/pages/account_settings.dart | 6 +++++- packages/neon_framework/lib/src/widgets/account_tile.dart | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/neon_framework/lib/src/pages/account_settings.dart b/packages/neon_framework/lib/src/pages/account_settings.dart index 905be2517c0..e4397acb0c0 100644 --- a/packages/neon_framework/lib/src/pages/account_settings.dart +++ b/packages/neon_framework/lib/src/pages/account_settings.dart @@ -14,6 +14,7 @@ import 'package:neon_framework/src/theme/dialog.dart'; import 'package:neon_framework/src/widgets/dialog.dart'; import 'package:neon_framework/src/widgets/error.dart'; import 'package:neon_framework/utils.dart'; +import 'package:provider/provider.dart'; /// Account settings page. /// @@ -163,7 +164,10 @@ class AccountSettingsPage extends StatelessWidget { child: Center( child: ConstrainedBox( constraints: NeonDialogTheme.of(context).constraints, - child: body, + child: Provider.value( + value: account, + child: body, + ), ), ), ), diff --git a/packages/neon_framework/lib/src/widgets/account_tile.dart b/packages/neon_framework/lib/src/widgets/account_tile.dart index 7420e861d8a..08917f28872 100644 --- a/packages/neon_framework/lib/src/widgets/account_tile.dart +++ b/packages/neon_framework/lib/src/widgets/account_tile.dart @@ -9,6 +9,7 @@ import 'package:neon_framework/src/widgets/adaptive_widgets/list_tile.dart'; import 'package:neon_framework/src/widgets/error.dart'; import 'package:neon_framework/src/widgets/linear_progress_indicator.dart'; import 'package:neon_framework/src/widgets/user_avatar.dart'; +import 'package:provider/provider.dart'; /// List tile to display account information. @internal @@ -41,7 +42,7 @@ class NeonAccountTile extends StatelessWidget { @override Widget build(BuildContext context) { - return AdaptiveListTile( + final widget = AdaptiveListTile( onTap: onTap, leading: NeonUserAvatar( account: account, @@ -78,5 +79,10 @@ class NeonAccountTile extends StatelessWidget { overflow: TextOverflow.ellipsis, ), ); + + return Provider.value( + value: account, + child: widget, + ); } }