From 79d975e05aa607d7e921496b2138c51b98790c90 Mon Sep 17 00:00:00 2001 From: Lucas Delanier Date: Mon, 31 Jul 2023 19:21:25 +0200 Subject: [PATCH] get post --- .../lib/components/post_component.dart | 17 +++++++++-------- .../lib/components/profile_component.dart | 2 +- .../lib/components/top_nav_bar_component.dart | 4 ++-- Sources/justMUSIC/lib/screens/feed_screen.dart | 5 ++++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Sources/justMUSIC/lib/components/post_component.dart b/Sources/justMUSIC/lib/components/post_component.dart index e550494..da0ff03 100644 --- a/Sources/justMUSIC/lib/components/post_component.dart +++ b/Sources/justMUSIC/lib/components/post_component.dart @@ -99,9 +99,10 @@ class _PostComponentState extends State { ), ), ), - widget.post.date.isAtSameMomentAs(DateTime.now()) + DateTime(today.year, today.month, today.day).isAtSameMomentAs( + DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) ? Text( - "Aujourd'hui, ${widget.post.date.hour}", + "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", style: GoogleFonts.plusJakartaSans( color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, @@ -165,8 +166,8 @@ class _PostComponentState extends State { padding: EdgeInsets.all(12), child: Container( constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), - width: 80.sp, - height: 80.sp, + width: 90.sp, + height: 90.sp, decoration: BoxDecoration( color: Colors.white, // add border @@ -268,8 +269,8 @@ class _PostComponentState extends State { ClipOval( child: SizedBox.fromSize( // Image radius - child: const Image( - image: AssetImage("assets/images/exemple_profile.png"), + child: Image( + image: NetworkImage(user.pp), width: 40, ), ), @@ -377,8 +378,8 @@ class _PostComponentState extends State { padding: EdgeInsets.all(12), child: Container( constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), - width: 80.sp, - height: 80.sp, + width: 90.sp, + height: 90.sp, decoration: BoxDecoration( color: Colors.white, // add border diff --git a/Sources/justMUSIC/lib/components/profile_component.dart b/Sources/justMUSIC/lib/components/profile_component.dart index dcfa8c6..9b18d1b 100644 --- a/Sources/justMUSIC/lib/components/profile_component.dart +++ b/Sources/justMUSIC/lib/components/profile_component.dart @@ -20,7 +20,7 @@ class ProfileComponent extends StatelessWidget { child: ConstrainedBox( constraints: BoxConstraints(maxWidth: 200, maxHeight: 200), child: Image( - image: AssetImage("assets/images/exemple_profile.png"), + image: NetworkImage(user.pp), height: 100.w, width: 100.w, ), diff --git a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart index 4d4bc92..cfe2e29 100644 --- a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart +++ b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart @@ -189,8 +189,8 @@ class _TopNavBarComponentState extends State with TickerProv child: ClipOval( child: SizedBox.fromSize( // Image radius - child: const Image( - image: AssetImage("assets/images/exemple_profile.png"), + child: Image( + image: NetworkImage(MyApp.userViewModel.userCurrent.pp), width: 30, ), ), diff --git a/Sources/justMUSIC/lib/screens/feed_screen.dart b/Sources/justMUSIC/lib/screens/feed_screen.dart index 32055e7..d904874 100644 --- a/Sources/justMUSIC/lib/screens/feed_screen.dart +++ b/Sources/justMUSIC/lib/screens/feed_screen.dart @@ -119,7 +119,10 @@ class _FeedScreenState extends State with SingleTickerProviderStateM post: displayFeed[index], index: index, ), - Container(height: 10), + Container(height: 5), + Text('${displayFeed[index].description ?? ""}', + style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w200)), + Container(height: 20), Align( child: RichText( text: TextSpan(