Skip to content

Commit

Permalink
fix(neon_framework): Fix active account propagation for account setti…
Browse files Browse the repository at this point in the history
…ngs and tile

Signed-off-by: provokateurin <[email protected]>
  • Loading branch information
provokateurin committed Aug 16, 2024
1 parent b9e1bac commit 60d46a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/neon_framework/lib/src/pages/account_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -163,7 +164,10 @@ class AccountSettingsPage extends StatelessWidget {
child: Center(
child: ConstrainedBox(
constraints: NeonDialogTheme.of(context).constraints,
child: body,
child: Provider<Account>.value(
value: account,
child: body,
),
),
),
),
Expand Down
8 changes: 7 additions & 1 deletion packages/neon_framework/lib/src/widgets/account_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -41,7 +42,7 @@ class NeonAccountTile extends StatelessWidget {

@override
Widget build(BuildContext context) {
return AdaptiveListTile(
final widget = AdaptiveListTile(
onTap: onTap,
leading: NeonUserAvatar(
account: account,
Expand Down Expand Up @@ -78,5 +79,10 @@ class NeonAccountTile extends StatelessWidget {
overflow: TextOverflow.ellipsis,
),
);

return Provider<Account>.value(
value: account,
child: widget,
);
}
}

0 comments on commit 60d46a3

Please sign in to comment.