forked from eatvio/eatvio_app
refactor(blog_post): Dio, retrfit and freezed implemented for blog post show screen
This commit is contained in:
@@ -8,7 +8,7 @@ class FeedCubit extends Cubit<FeedState> {
|
||||
FeedCubit({required this.feedRepository}) : super(const FeedState.loading());
|
||||
|
||||
loadFeedBlogPostList() async {
|
||||
emit(const FeedStateLoading());
|
||||
emit(const FeedState.loading());
|
||||
try {
|
||||
final feedBlogPostList = await feedRepository.getFeedBlogPostList();
|
||||
emit(FeedState.loaded(feedBlogPostList: feedBlogPostList));
|
||||
|
||||
@@ -100,7 +100,8 @@ class FeedScreen extends StatelessWidget {
|
||||
flex: 1,
|
||||
child: CustomOutlinedButton(
|
||||
text: "+",
|
||||
onPressed: () => GoRouter.of(context).goNamed('blogPostCreateScreen'),
|
||||
onPressed: () =>
|
||||
GoRouter.of(context).goNamed('blogPostCreateScreen'),
|
||||
buttonStyle: CustomButtonStyles.outlinePrimaryTL15,
|
||||
),
|
||||
),
|
||||
@@ -144,7 +145,7 @@ class FeedScreen extends StatelessWidget {
|
||||
children: [
|
||||
ListTile(
|
||||
leading: CachedNetworkImage(
|
||||
imageUrl: dotenv.env['STORAGE_URL']! + ('' ?? ''),
|
||||
imageUrl: dotenv.env['STORAGE_URL']! + (''),
|
||||
|
||||
/// todo profile photo path
|
||||
imageBuilder: (context, imageProvider) => CircleAvatar(
|
||||
@@ -215,11 +216,12 @@ class FeedScreen extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 16.0),
|
||||
CachedNetworkImage(
|
||||
imageUrl: dotenv.env['STORAGE_URL']! + (post.image ?? ''),
|
||||
imageUrl: dotenv.env['STORAGE_URL']! + (post.image),
|
||||
imageBuilder: (context, imageProvider) => Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
|
||||
borderRadius:
|
||||
const BorderRadius.all(Radius.circular(8.0)),
|
||||
child: Image(
|
||||
image: imageProvider,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user