fix: comments and feed

This commit is contained in:
Alex
2024-12-02 17:35:32 +03:00
parent 66f6f0ed91
commit a4b2711914
3 changed files with 14 additions and 10 deletions

View File

@@ -9,7 +9,9 @@ class FeedCubit extends Cubit<FeedState> {
bool isLoading = false;
String? _query;
FeedCubit({required this.feedRepository,}) : super(const FeedState.loading());
FeedCubit({
required this.feedRepository,
}) : super(const FeedState.loading());
loadFeedBlogPostList({
String? query,

View File

@@ -34,7 +34,7 @@ class FeedScreen extends StatefulWidget {
}
class _FeedScreenState extends State<FeedScreen> {
late final FeedCubit feedCubit;
final FeedCubit feedCubit = sl<FeedCubit>();
final RecipesCubit recipesCubit = sl<RecipesCubit>()..loadRecipesList();
final DietsCubit dietsCubit = sl<DietsCubit>()..loadDiets();
final PlansCubit plansCubit = sl<PlansCubit>()..loadPlans();
@@ -49,7 +49,6 @@ class _FeedScreenState extends State<FeedScreen> {
@override
void initState() {
feedCubit = context.read<FeedCubit>();
feedCubit.loadFeedBlogPostList();
blogPostsScrollController.addListener(_onScrollBlogPosts);
recipesScrollController.addListener(_onScrollRecipes);

View File

@@ -77,13 +77,16 @@ class _CommentsWidgetState extends State<CommentsWidget> {
),
),
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),