diff --git a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart index e5839487..802f9a18 100644 --- a/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart +++ b/lib/features/feed/presentation/bloc/feed_cubit/feed_cubit.dart @@ -9,7 +9,9 @@ class FeedCubit extends Cubit { bool isLoading = false; String? _query; - FeedCubit({required this.feedRepository,}) : super(const FeedState.loading()); + FeedCubit({ + required this.feedRepository, + }) : super(const FeedState.loading()); loadFeedBlogPostList({ String? query, diff --git a/lib/features/feed/presentation/pages/feed_screen.dart b/lib/features/feed/presentation/pages/feed_screen.dart index cbaa0463..611a9015 100644 --- a/lib/features/feed/presentation/pages/feed_screen.dart +++ b/lib/features/feed/presentation/pages/feed_screen.dart @@ -34,7 +34,7 @@ class FeedScreen extends StatefulWidget { } class _FeedScreenState extends State { - late final FeedCubit feedCubit; + final FeedCubit feedCubit = sl(); final RecipesCubit recipesCubit = sl()..loadRecipesList(); final DietsCubit dietsCubit = sl()..loadDiets(); final PlansCubit plansCubit = sl()..loadPlans(); @@ -49,7 +49,6 @@ class _FeedScreenState extends State { @override void initState() { - feedCubit = context.read(); feedCubit.loadFeedBlogPostList(); blogPostsScrollController.addListener(_onScrollBlogPosts); recipesScrollController.addListener(_onScrollRecipes); diff --git a/lib/features/feed/presentation/widgets/comments_widget.dart b/lib/features/feed/presentation/widgets/comments_widget.dart index 96391ca8..fd931541 100644 --- a/lib/features/feed/presentation/widgets/comments_widget.dart +++ b/lib/features/feed/presentation/widgets/comments_widget.dart @@ -77,13 +77,16 @@ class _CommentsWidgetState extends State { ), ), SizedBox(height: 4), - Text( - comment.body, - style: TextStyle( - height: 1, - color: appTheme.black, - fontSize: 12, - fontWeight: FontWeight.w500, + SizedBox( + width: MediaQuery.of(context).size.width * 0.8, + child: Text( + comment.body, + style: TextStyle( + height: 1, + color: appTheme.black, + fontSize: 12, + fontWeight: FontWeight.w500, + ), ), ), SizedBox(height: 4),