forked from eatvio/eatvio_app
feat(feed): Search field (static), menu bar added. Feed and comment scroll fixed
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'bloc/blog_post_bloc.dart';
|
||||
import 'models/blog_post_model.dart';
|
||||
import 'models/comment_model.dart';
|
||||
import 'widgets/comment_widget.dart';
|
||||
import 'package:eatvio_app/core/app_export.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -150,15 +149,10 @@ class BlogPostScreen extends StatelessWidget {
|
||||
),
|
||||
child: Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Spacer(),
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
state.blog_post?['title'],
|
||||
style: CustomTextStyles.titleMediumBlack,
|
||||
),
|
||||
Text(
|
||||
state.blog_post?['title'],
|
||||
style: CustomTextStyles.titleMediumBlack,
|
||||
),
|
||||
Spacer(),
|
||||
PopupMenuButton<String>(
|
||||
@@ -361,20 +355,26 @@ class BlogPostScreen extends StatelessWidget {
|
||||
}
|
||||
|
||||
_buildCommentSection(BuildContext context, BlogPostLoadedState state) {
|
||||
return ListView.separated(
|
||||
shrinkWrap: true,
|
||||
separatorBuilder: (context, index) {
|
||||
return SizedBox(
|
||||
height: 10.v,
|
||||
);
|
||||
},
|
||||
itemCount: state.comments?.length ?? 0,
|
||||
itemBuilder: (context, index) {
|
||||
CommentModel model = state.comments?[index];
|
||||
return CommentWidget(
|
||||
model,
|
||||
);
|
||||
});
|
||||
if (state.comments != null && state.comments!.isNotEmpty) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
for (int i = 0; i < state.comments!.length; i++)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
CommentWidget(state.comments![i]),
|
||||
SizedBox(height: 10.0), // Separator
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
// Return a message or placeholder widget when there are no comments
|
||||
return Center(
|
||||
child: Text('No comments available'),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_buildBottomBar(BuildContext context) {
|
||||
|
||||
Reference in New Issue
Block a user