fix probleme with date displaying "hier" when display date
continuous-integration/drone/push Build is passing Details

FIX_LIKES_LDE
Lucas Delanier 2 years ago
parent d714e18cbb
commit 2b6182f5d0

@ -27,7 +27,6 @@ class _ButtonPlayComponentState extends State<ButtonPlayComponent> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
child: GestureDetector(
onTap: () { onTap: () {
if (isPlaying) { if (isPlaying) {
widget.music.stopSong(); widget.music.stopSong();
@ -46,6 +45,6 @@ class _ButtonPlayComponentState extends State<ButtonPlayComponent> {
color: Colors.white, color: Colors.white,
size: 45, size: 45,
), ),
)); );
} }
} }

@ -111,151 +111,149 @@ class _DetailPostScreenState extends State<DetailPostScreen> {
), ),
Column( Column(
children: [ children: [
IgnorePointer( Container(
child: Container( height: 200,
height: 200, margin: EdgeInsets.only(top: 230),
margin: EdgeInsets.only(top: 230), width: double.infinity,
width: double.infinity, decoration: BoxDecoration(
decoration: BoxDecoration( gradient: LinearGradient(
gradient: LinearGradient( begin: Alignment.topCenter,
begin: Alignment.topCenter, end: Alignment.bottomCenter,
end: Alignment.bottomCenter, colors: [
colors: [ Colors.transparent,
Colors.transparent, bgModal.withOpacity(0.5),
bgModal.withOpacity(0.5), bgModal.withOpacity(0.75),
bgModal.withOpacity(0.75), bgModal
bgModal ],
], stops: [0, 0.2, 0.4, 0.8],
stops: [0, 0.2, 0.4, 0.8],
),
), ),
child: Padding( ),
padding: const EdgeInsets.fromLTRB(20, 0, 20, 10), child: Padding(
child: Row( padding: const EdgeInsets.fromLTRB(20, 0, 20, 10),
crossAxisAlignment: CrossAxisAlignment.end, child: Row(
children: [ crossAxisAlignment: CrossAxisAlignment.end,
Padding( children: [
padding: const EdgeInsets.only(right: 10), Padding(
child: choice padding: const EdgeInsets.only(right: 10),
? Padding( child: choice
padding: const EdgeInsets.all(4), ? Padding(
child: ClipOval( padding: const EdgeInsets.all(4),
child: SizedBox.fromSize( child: ClipOval(
// Image radius child: SizedBox.fromSize(
child: ProfilPictureComponent(user: widget.post.user), // Image radius
), child: ProfilPictureComponent(user: widget.post.user),
), ),
)
: widget.post.music.previewUrl != null
? ButtonPlayComponent(music: widget.post.music)
: Container(),
),
Flexible(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Flexible(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: ScrollConfiguration(
behavior: ScrollBehavior().copyWith(scrollbars: false),
child: TextScroll(
choice ? widget.post.user.pseudo : widget.post.music.title!,
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w800,
fontSize: 22,
),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
),
),
),
Padding(
padding: const EdgeInsets.only(left: 20.0),
child: choice
? 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}:${widget.post.date.minute}",
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w900,
fontSize: 18,
),
)
: Text(
"hier, ${widget.post.date.hour}:${widget.post.date.minute}",
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w900,
fontSize: 18,
),
)
: Text(
widget.post.music.date.toString(),
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w900,
fontSize: 18,
),
),
),
],
), ),
), )
choice : widget.post.music.previewUrl != null
? widget.post.location.item2 != null ? ButtonPlayComponent(music: widget.post.music)
? Text( : Container(),
"${widget.post.location.item1}, ${widget.post.location.item2}", ),
style: GoogleFonts.plusJakartaSans( Flexible(
color: Colors.white.withOpacity(0.5), child: Column(
fontWeight: FontWeight.w400, mainAxisAlignment: MainAxisAlignment.end,
fontSize: 15, crossAxisAlignment: CrossAxisAlignment.start,
), children: [
) Flexible(
: Text( child: Row(
"", crossAxisAlignment: CrossAxisAlignment.end,
style: GoogleFonts.plusJakartaSans( children: [
color: Colors.white.withOpacity(0.4), Expanded(
fontWeight: FontWeight.w300, child: ScrollConfiguration(
fontSize: 13,
),
)
: ScrollConfiguration(
behavior: ScrollBehavior().copyWith(scrollbars: false), behavior: ScrollBehavior().copyWith(scrollbars: false),
child: TextScroll( child: TextScroll(
widget.post.music.artists.first.name!, choice ? widget.post.user.pseudo : widget.post.music.title!,
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
height: 1, height: 1,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w800,
fontSize: 17, fontSize: 22,
), ),
mode: TextScrollMode.endless, mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500), pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)), velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
), ),
), ),
], ),
), Padding(
padding: const EdgeInsets.only(left: 20.0),
child: choice
? 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}:${widget.post.date.minute}",
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w900,
fontSize: 18,
),
)
: Text(
"hier, ${widget.post.date.hour}:${widget.post.date.minute}",
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w900,
fontSize: 18,
),
)
: Text(
widget.post.music.date.toString(),
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w900,
fontSize: 18,
),
),
),
],
),
),
choice
? widget.post.location.item2 != null
? Text(
"${widget.post.location.item1}, ${widget.post.location.item2}",
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.5),
fontWeight: FontWeight.w400,
fontSize: 15,
),
)
: Text(
"",
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.4),
fontWeight: FontWeight.w300,
fontSize: 13,
),
)
: ScrollConfiguration(
behavior: ScrollBehavior().copyWith(scrollbars: false),
child: TextScroll(
widget.post.music.artists.first.name!,
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w500,
fontSize: 17,
),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
),
),
],
), ),
], ),
), ],
), ),
), ),
), ),

Loading…
Cancel
Save