refactor(blog_post): Dio, retrfit and freezed implemented for blog post show screen

This commit is contained in:
2024-06-28 14:41:30 +03:00
parent 060fb512a0
commit 02f4008394
17 changed files with 1397 additions and 468 deletions

View File

@@ -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));

View File

@@ -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,
),