forked from eatvio/eatvio_app
feat(feed): Comment creation API and state update
This commit is contained in:
@@ -34,6 +34,9 @@ class FeedBloc extends Bloc<FeedEvent, FeedState> {
|
||||
}
|
||||
final response = await http.get(
|
||||
Uri.parse(dotenv.env['SERVER_ROOT']! + '/feed/index'),
|
||||
headers: {
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
);
|
||||
print('Got response');
|
||||
if (response.statusCode == 200) {
|
||||
|
||||
@@ -118,7 +118,6 @@ class FeedScreen extends StatelessWidget {
|
||||
itemCount: state.posts?.length ?? 0,
|
||||
itemBuilder: (context, index) {
|
||||
final post = state.posts?[index];
|
||||
print(post['author']['name']);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 10),
|
||||
decoration: BoxDecoration(
|
||||
@@ -161,7 +160,7 @@ class FeedScreen extends StatelessWidget {
|
||||
onTap: () => Navigator.pushNamed(
|
||||
context,
|
||||
AppRoutes.blogPostScreen,
|
||||
arguments: post?['id'].toString(),
|
||||
arguments: post?['post']['id'].toString(),
|
||||
),
|
||||
trailing: PopupMenuButton<String>(
|
||||
onSelected: (value) => print("tap"),
|
||||
|
||||
Reference in New Issue
Block a user