forked from eatvio/eatvio_app
feat(feed): Author name and avatar fetched from API
This commit is contained in:
@@ -118,7 +118,7 @@ class FeedScreen extends StatelessWidget {
|
||||
itemCount: state.posts?.length ?? 0,
|
||||
itemBuilder: (context, index) {
|
||||
final post = state.posts?[index];
|
||||
print(post);
|
||||
print(post['author']['name']);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 10),
|
||||
decoration: BoxDecoration(
|
||||
@@ -136,7 +136,8 @@ class FeedScreen extends StatelessWidget {
|
||||
child: Column(children: [
|
||||
ListTile(
|
||||
leading: CachedNetworkImage(
|
||||
imageUrl: dotenv.env['STORAGE_URL']! + post['image'],
|
||||
imageUrl: dotenv.env['STORAGE_URL']! +
|
||||
(post["author"]['profile_photo_path'] ?? ''),
|
||||
imageBuilder: (context, imageProvider) => CircleAvatar(
|
||||
backgroundImage: imageProvider,
|
||||
radius: 25,
|
||||
@@ -149,12 +150,12 @@ class FeedScreen extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
post?['title'] ?? '',
|
||||
post?['author']['name'] ?? '',
|
||||
style: CustomTextStyles.titleMediumSemiBold,
|
||||
),
|
||||
subtitle: Text(
|
||||
DateFormat('dd.MM.yyyy')
|
||||
.format(DateTime.parse(post?['updated_at'])),
|
||||
.format(DateTime.parse(post?['post']['updated_at'])),
|
||||
style: theme.textTheme.bodyMedium,
|
||||
),
|
||||
onTap: () => Navigator.pushNamed(
|
||||
@@ -188,7 +189,7 @@ class FeedScreen extends StatelessWidget {
|
||||
Align(
|
||||
alignment: Alignment.center,
|
||||
child: Text(
|
||||
post?['title'],
|
||||
post?['post']['title'],
|
||||
style: CustomTextStyles.titleMediumBlack,
|
||||
),
|
||||
),
|
||||
@@ -197,13 +198,13 @@ class FeedScreen extends StatelessWidget {
|
||||
),
|
||||
SizedBox(height: 8.0),
|
||||
Text(
|
||||
post?['description'],
|
||||
post?['post']['description'],
|
||||
style: CustomTextStyles.bodyMediumBluegray800,
|
||||
),
|
||||
SizedBox(height: 16.0),
|
||||
CachedNetworkImage(
|
||||
imageUrl:
|
||||
dotenv.env['STORAGE_URL']! + (post?['image'] ?? ''),
|
||||
imageUrl: dotenv.env['STORAGE_URL']! +
|
||||
(post?['post']['image'] ?? ''),
|
||||
imageBuilder: (context, imageProvider) => Stack(
|
||||
children: [
|
||||
ClipRRect(
|
||||
|
||||
Reference in New Issue
Block a user