Skip to content

Commit ba6b10c

Browse files
committed
fix(widgets): wrap user avatar in Directionality to resolve layout issues
- Add Directionality widget around NotificationIndicator in both DiscoverSliverAppBar and FeedSliverAppBar - Use Directionality.of(context) to inherit the correct text direction - This change ensures proper layout behavior for right-to-left languages
1 parent 343d9df commit ba6b10c

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

lib/discover/widgets/discover_sliver_app_bar.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,16 @@ class DiscoverSliverAppBar extends StatelessWidget
7979
child: BlocSelector<AppBloc, AppState, bool>(
8080
selector: (state) => state.hasUnreadInAppNotifications,
8181
builder: (context, showIndicator) {
82-
return NotificationIndicator(
83-
showIndicator: showIndicator,
84-
child: BlocSelector<AppBloc, AppState, User?>(
85-
selector: (state) => state.user,
86-
builder: (context, user) {
87-
return UserAvatar(user: user);
88-
},
82+
return Directionality(
83+
textDirection: Directionality.of(context),
84+
child: NotificationIndicator(
85+
showIndicator: showIndicator,
86+
child: BlocSelector<AppBloc, AppState, User?>(
87+
selector: (state) => state.user,
88+
builder: (context, user) {
89+
return UserAvatar(user: user);
90+
},
91+
),
8992
),
9093
);
9194
},

lib/headlines-feed/widgets/feed_sliver_app_bar.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,16 @@ class FeedSliverAppBar extends StatelessWidget implements PreferredSizeWidget {
8585
child: BlocSelector<AppBloc, AppState, bool>(
8686
selector: (state) => state.hasUnreadInAppNotifications,
8787
builder: (context, showIndicator) {
88-
return NotificationIndicator(
89-
showIndicator: showIndicator,
90-
child: BlocSelector<AppBloc, AppState, User?>(
91-
selector: (state) => state.user,
92-
builder: (context, user) {
93-
return UserAvatar(user: user);
94-
},
88+
return Directionality(
89+
textDirection: Directionality.of(context),
90+
child: NotificationIndicator(
91+
showIndicator: showIndicator,
92+
child: BlocSelector<AppBloc, AppState, User?>(
93+
selector: (state) => state.user,
94+
builder: (context, user) {
95+
return UserAvatar(user: user);
96+
},
97+
),
9598
),
9699
);
97100
},

0 commit comments

Comments
 (0)