GET_CAPSULES_LDE-EKA
Lucas Delanier 2 years ago
parent a46f6325ba
commit a00f9370f6

@ -4,9 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:gradient_borders/box_borders/gradient_box_border.dart'; import 'package:gradient_borders/box_borders/gradient_box_border.dart';
import 'package:justmusic/main.dart';
import 'package:justmusic/model/Music.dart';
import 'package:justmusic/model/User.dart';
import 'package:text_scroll/text_scroll.dart'; import 'package:text_scroll/text_scroll.dart';
import 'package:zoom_tap_animation/zoom_tap_animation.dart'; import 'package:zoom_tap_animation/zoom_tap_animation.dart';
@ -17,12 +14,7 @@ class PostComponent extends StatefulWidget {
final Post post; final Post post;
final int index; final int index;
PostComponent( PostComponent({Key? key, required this.callback, required this.post, required this.index}) : super(key: key);
{Key? key,
required this.callback,
required this.post,
required this.index})
: super(key: key);
@override @override
State<PostComponent> createState() => _PostComponentState(); State<PostComponent> createState() => _PostComponentState();
@ -32,14 +24,6 @@ class _PostComponentState extends State<PostComponent> {
bool choice = false; bool choice = false;
DateTime today = DateTime.now(); DateTime today = DateTime.now();
Future<User?> fetchUserData() async {
//return await MyApp.userViewModel.getUser(widget.post.idUser);
}
Future<Music?> fetchMusicData() async {
//return await MyApp.musicViewModel.getMusic(widget.post.idMusic);
}
void switchChoice() { void switchChoice() {
setState(() { setState(() {
choice = !choice; choice = !choice;
@ -62,501 +46,388 @@ class _PostComponentState extends State<PostComponent> {
if (widget.callback == null) { if (widget.callback == null) {
return SizedBox( return SizedBox(
width: double.infinity, width: double.infinity,
child: FutureBuilder( child: Column(
future: Future.wait([fetchMusicData(), fetchUserData()]), children: [
builder: (context, AsyncSnapshot<List<dynamic>> snapshot) { Row(
if (snapshot.hasData) { crossAxisAlignment: CrossAxisAlignment.end,
final music = snapshot.data![0] as Music; children: [
final user = snapshot.data![1] as User; ClipOval(
return Column( child: SizedBox.fromSize(
children: [ // Image radius
Row( child: Image(
crossAxisAlignment: CrossAxisAlignment.end, image: NetworkImage(widget.post.user.pp),
width: 40,
),
),
),
Expanded(
flex: 8,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
ClipOval( Text(
child: SizedBox.fromSize( widget.post.user.pseudo,
// Image radius style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600),
child: Image(
image: NetworkImage(user.pp),
width: 40,
),
),
),
Expanded(
flex: 8,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
user.pseudo,
style: GoogleFonts.plusJakartaSans(
color: Colors.white,
fontWeight: FontWeight.w600),
),
widget.post.location.item2 != null
? Text(
"${widget.post.location?.item1}, ${widget.post.location?.item2}",
style:
GoogleFonts.plusJakartaSans(
color: Colors.white
.withOpacity(0.4),
fontWeight:
FontWeight.w300,
fontSize: 13),
)
: Text(
"",
style:
GoogleFonts.plusJakartaSans(
color: Colors.white
.withOpacity(0.4),
fontWeight:
FontWeight.w300,
fontSize: 13),
)
],
),
),
), ),
DateTime(today.year, today.month, today.day) widget.post.location.item2 != null
.isAtSameMomentAs(DateTime(
widget.post.date.year,
widget.post.date.month,
widget.post.date.day))
? Text( ? Text(
"Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", "${widget.post.location.item1}, ${widget.post.location.item2}",
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
color: color: Colors.white.withOpacity(0.4),
Colors.white.withOpacity(0.4),
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
fontSize: 13), fontSize: 13),
) )
: Text( : Text(
"${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}", "",
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
color: color: Colors.white.withOpacity(0.4),
Colors.white.withOpacity(0.4),
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
fontSize: 13), fontSize: 13),
), )
], ],
), ),
SizedBox(height: 10), ),
ZoomTapAnimation( ),
onTap: () { DateTime(today.year, today.month, today.day).isAtSameMomentAs(
if (widget.post.selfie != null) { DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day))
switchChoice(); ? Text(
} "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}",
}, style: GoogleFonts.plusJakartaSans(
enableLongTapRepeatEvent: false, color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13),
longTapRepeatDuration: )
const Duration(milliseconds: 100), : Text(
begin: 1.0, "${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}",
end: 0.99, style: GoogleFonts.plusJakartaSans(
beginDuration: const Duration(milliseconds: 70), color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13),
endDuration: const Duration(milliseconds: 100), ),
beginCurve: Curves.decelerate, ],
endCurve: Curves.easeInOutSine, ),
child: AspectRatio( SizedBox(height: 10),
aspectRatio: 1 / 1, ZoomTapAnimation(
child: Container( onTap: () {
decoration: BoxDecoration( if (widget.post.selfie != null) {
// add border switchChoice();
border: const GradientBoxBorder( }
gradient: LinearGradient( },
colors: [ enableLongTapRepeatEvent: false,
Colors.transparent, longTapRepeatDuration: const Duration(milliseconds: 100),
Color(0xFF323232), begin: 1.0,
], end: 0.99,
begin: Alignment.topCenter, beginDuration: const Duration(milliseconds: 70),
end: Alignment.bottomCenter), endDuration: const Duration(milliseconds: 100),
width: 2.5, beginCurve: Curves.decelerate,
), endCurve: Curves.easeInOutSine,
// set border radius child: AspectRatio(
borderRadius: BorderRadius.circular(20), aspectRatio: 1 / 1,
), child: Container(
child: ClipRRect( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18), // add border
// implement image border: const GradientBoxBorder(
child: Stack( gradient: LinearGradient(colors: [
alignment: Alignment.bottomCenter, Colors.transparent,
children: [ Color(0xFF323232),
Image( ], begin: Alignment.topCenter, end: Alignment.bottomCenter),
image: NetworkImage(choice width: 2.5,
? widget.post.selfie! ),
: music.cover!), // set border radius
fit: BoxFit.cover, borderRadius: BorderRadius.circular(20),
width: double.infinity, ),
), child: ClipRRect(
widget.post.selfie != null borderRadius: BorderRadius.circular(18),
? Positioned( // implement image
top: 0, child: Stack(
right: 0, alignment: Alignment.bottomCenter,
child: Padding( children: [
padding: EdgeInsets.all(12), Image(
child: Container( image: NetworkImage(choice ? widget.post.selfie! : widget.post.music.cover!),
constraints: fit: BoxFit.cover,
BoxConstraints( width: double.infinity,
maxWidth: 140,
maxHeight: 140),
width: 90.sp,
height: 90.sp,
decoration: BoxDecoration(
color: Colors.white,
// add border
border: Border.all(
width: 3,
color:
Colors.white),
// set border radius
borderRadius:
BorderRadius
.circular(15),
),
child: ClipRRect(
borderRadius:
BorderRadius
.circular(13),
// implement image
child: Image(
image: NetworkImage(
choice
? music.cover!
: widget.post
.selfie!),
fit: BoxFit.cover,
),
),
),
))
: Container(),
],
),
),
),
)),
SizedBox(height: 15),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 8,
child: TextScroll(
music.artists.first.name!,
style: GoogleFonts.plusJakartaSans(
height: 1,
color: Colors.white,
fontWeight: FontWeight.w600,
fontSize: 26.h),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(
pixelsPerSecond: Offset(20, 0)),
)),
Padding(
padding: EdgeInsets.only(
bottom: 10.h, right: 5.w, left: 5.w),
child: ClipOval(
child: Container(
width: 5.h,
height: 5.h,
color: Colors.white,
),
), ),
), widget.post.selfie != null
Expanded( ? Positioned(
flex: 8, top: 0,
child: Padding( right: 0,
padding: EdgeInsets.only(bottom: 2), child: Padding(
child: TextScroll( padding: EdgeInsets.all(12),
music.title!, child: Container(
style: GoogleFonts.plusJakartaSans( constraints: BoxConstraints(maxWidth: 140, maxHeight: 140),
height: 1, width: 90.sp,
color: Colors.white, height: 90.sp,
fontWeight: FontWeight.w300, decoration: BoxDecoration(
fontSize: 16.h), color: Colors.white,
mode: TextScrollMode.endless, // add border
velocity: Velocity( border: Border.all(width: 3, color: Colors.white),
pixelsPerSecond: Offset(50, 20)), // set border radius
pauseBetween: borderRadius: BorderRadius.circular(15),
Duration(milliseconds: 500), ),
), child: ClipRRect(
)), borderRadius: BorderRadius.circular(13),
Container(width: 10), // implement image
AutoSizeText( child: Image(
music.date.toString(), image: NetworkImage(
style: GoogleFonts.plusJakartaSans( choice ? widget.post.music.cover! : widget.post.selfie!),
color: Colors.white.withOpacity(0.5), fit: BoxFit.cover,
fontWeight: FontWeight.w300, ),
fontSize: 16.h), ),
textAlign: TextAlign.end, ),
maxFontSize: 20, ))
), : Container(),
], ],
),
),
),
)),
SizedBox(height: 15),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 8,
child: TextScroll(
widget.post.music.artists.first.name!,
style: GoogleFonts.plusJakartaSans(
height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
)),
Padding(
padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w),
child: ClipOval(
child: Container(
width: 5.h,
height: 5.h,
color: Colors.white,
), ),
], ),
); ),
} else { Expanded(
return CupertinoActivityIndicator(); flex: 8,
} child: Padding(
})); padding: EdgeInsets.only(bottom: 2),
child: TextScroll(
widget.post.music.title!,
style: GoogleFonts.plusJakartaSans(
height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h),
mode: TextScrollMode.endless,
velocity: Velocity(pixelsPerSecond: Offset(50, 20)),
pauseBetween: Duration(milliseconds: 500),
),
)),
Container(width: 10),
AutoSizeText(
widget.post.music.date.toString(),
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h),
textAlign: TextAlign.end,
maxFontSize: 20,
),
],
),
],
));
} }
return SizedBox( return SizedBox(
width: double.infinity, width: double.infinity,
child: FutureBuilder( child: Column(
future: Future.wait([fetchMusicData(), fetchUserData()]), children: [
builder: (context, AsyncSnapshot<List<dynamic>> snapshot) { Row(
if (snapshot.hasData) { crossAxisAlignment: CrossAxisAlignment.end,
final music = snapshot.data![0] as Music; children: [
final user = snapshot.data![1] as User; ClipOval(
return Column( child: SizedBox.fromSize(
children: [ // Image radius
Row( child: Image(
crossAxisAlignment: CrossAxisAlignment.end, image: NetworkImage(widget.post.user.pp),
width: 40,
),
),
),
Expanded(
flex: 8,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
ClipOval( Text(
child: SizedBox.fromSize( widget.post.user.pseudo,
// Image radius style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600),
child: Image(
image: NetworkImage(user.pp),
width: 40,
),
),
),
Expanded(
flex: 8,
child: Padding(
padding: const EdgeInsets.only(left: 10),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
user.pseudo,
style: GoogleFonts.plusJakartaSans(
color: Colors.white,
fontWeight: FontWeight.w600),
),
widget.post.location.item2 != null
? Text(
"${widget.post.location?.item1}, ${widget.post.location?.item2}",
style:
GoogleFonts.plusJakartaSans(
color: Colors.white
.withOpacity(0.4),
fontWeight:
FontWeight.w300,
fontSize: 13),
)
: Text(
"",
style:
GoogleFonts.plusJakartaSans(
color: Colors.white
.withOpacity(0.4),
fontWeight:
FontWeight.w300,
fontSize: 13),
)
],
),
),
), ),
DateTime(today.year, today.month, today.day) widget.post.location.item2 != null
.isAtSameMomentAs(DateTime(
widget.post.date.year,
widget.post.date.month,
widget.post.date.day))
? Text( ? Text(
"Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", "${widget.post.location?.item1}, ${widget.post.location?.item2}",
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.4), color: Colors.white.withOpacity(0.4),
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
fontSize: 13), fontSize: 13),
) )
: Text( : Text(
"${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}", "",
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.4), color: Colors.white.withOpacity(0.4),
fontWeight: FontWeight.w300, fontWeight: FontWeight.w300,
fontSize: 13), fontSize: 13),
), )
], ],
), ),
SizedBox(height: 10), ),
ZoomTapAnimation( ),
onTap: () { DateTime(today.year, today.month, today.day).isAtSameMomentAs(
widget.callback!(widget.index); DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day))
}, ? Text(
enableLongTapRepeatEvent: false, "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}",
longTapRepeatDuration: style: GoogleFonts.plusJakartaSans(
const Duration(milliseconds: 100), color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13),
begin: 1.0, )
end: 0.99, : Text(
beginDuration: const Duration(milliseconds: 70), "${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}",
endDuration: const Duration(milliseconds: 100), style: GoogleFonts.plusJakartaSans(
beginCurve: Curves.decelerate, color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13),
endCurve: Curves.easeInOutSine, ),
child: AspectRatio( ],
aspectRatio: 1 / 1, ),
child: Container( SizedBox(height: 10),
decoration: BoxDecoration( ZoomTapAnimation(
// add border onTap: () {
border: const GradientBoxBorder( widget.callback!(widget.index);
gradient: LinearGradient( },
colors: [ enableLongTapRepeatEvent: false,
Colors.transparent, longTapRepeatDuration: const Duration(milliseconds: 100),
Color(0xFF323232), begin: 1.0,
], end: 0.99,
begin: Alignment.topCenter, beginDuration: const Duration(milliseconds: 70),
end: Alignment.bottomCenter), endDuration: const Duration(milliseconds: 100),
width: 2.5, beginCurve: Curves.decelerate,
), endCurve: Curves.easeInOutSine,
// set border radius child: AspectRatio(
borderRadius: BorderRadius.circular(20), aspectRatio: 1 / 1,
), child: Container(
child: ClipRRect( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18), // add border
// implement image border: const GradientBoxBorder(
child: Stack( gradient: LinearGradient(colors: [
alignment: Alignment.bottomCenter, Colors.transparent,
children: [ Color(0xFF323232),
Image( ], begin: Alignment.topCenter, end: Alignment.bottomCenter),
image: NetworkImage(music.cover!), width: 2.5,
fit: BoxFit.cover, ),
width: double.infinity, // set border radius
), borderRadius: BorderRadius.circular(20),
Image( ),
image: AssetImage( child: ClipRRect(
"assets/images/shadow_post.png"), borderRadius: BorderRadius.circular(18),
fit: BoxFit.fitHeight, // implement image
width: double.infinity, child: Stack(
), alignment: Alignment.bottomCenter,
Padding( children: [
padding: EdgeInsets.all(15), Image(
child: AutoSizeText( image: NetworkImage(widget.post.music.cover!),
'${widget.post.description}', fit: BoxFit.cover,
style: GoogleFonts.plusJakartaSans( width: double.infinity,
color: Colors.white,
fontWeight: FontWeight.w400,
fontSize: 15.sp),
maxFontSize: 20,
maxLines: 1,
),
),
widget.post.selfie != null
? Positioned(
top: 0,
right: 0,
child: Padding(
padding: EdgeInsets.all(12),
child: Container(
constraints: BoxConstraints(
maxWidth: 140,
maxHeight: 140),
width: 90.sp,
height: 90.sp,
decoration: BoxDecoration(
color: Colors.white,
// add border
border: Border.all(
width: 3,
color: Colors.white),
// set border radius
borderRadius:
BorderRadius.circular(
15),
),
child: ClipRRect(
borderRadius:
BorderRadius.circular(
13),
// implement image
child: Image(
image: NetworkImage(
widget
.post.selfie!),
fit: BoxFit.cover,
),
),
),
))
: Container(),
],
),
),
), ),
)), Image(
SizedBox(height: 15), image: AssetImage("assets/images/shadow_post.png"),
Row( fit: BoxFit.fitHeight,
crossAxisAlignment: CrossAxisAlignment.end, width: double.infinity,
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: [ Padding(
Flexible( padding: EdgeInsets.all(15),
flex: 8, child: AutoSizeText(
child: TextScroll( '${widget.post.description}',
music.artists.first.name!,
style: GoogleFonts.plusJakartaSans( style: GoogleFonts.plusJakartaSans(
height: 1, color: Colors.white, fontWeight: FontWeight.w400, fontSize: 15.sp),
color: Colors.white, maxFontSize: 20,
fontWeight: FontWeight.w600, maxLines: 1,
fontSize: 26.h),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(
pixelsPerSecond: Offset(20, 0)),
)),
Padding(
padding: EdgeInsets.only(
bottom: 10.h, right: 5.w, left: 5.w),
child: ClipOval(
child: Container(
width: 5.h,
height: 5.h,
color: Colors.white,
), ),
), ),
), widget.post.selfie != null
Expanded( ? Positioned(
flex: 8, top: 0,
child: Padding( right: 0,
padding: EdgeInsets.only(bottom: 2), child: Padding(
child: TextScroll( padding: EdgeInsets.all(12),
music.title!, child: Container(
style: GoogleFonts.plusJakartaSans( constraints: BoxConstraints(maxWidth: 140, maxHeight: 140),
height: 1, width: 90.sp,
color: Colors.white, height: 90.sp,
fontWeight: FontWeight.w300, decoration: BoxDecoration(
fontSize: 16.h), color: Colors.white,
mode: TextScrollMode.endless, // add border
velocity: Velocity( border: Border.all(width: 3, color: Colors.white),
pixelsPerSecond: Offset(50, 20)), // set border radius
pauseBetween: Duration(milliseconds: 500), borderRadius: BorderRadius.circular(15),
), ),
)), child: ClipRRect(
Container(width: 10), borderRadius: BorderRadius.circular(13),
AutoSizeText( // implement image
music.date.toString(), child: Image(
style: GoogleFonts.plusJakartaSans( image: NetworkImage(widget.post.selfie!),
color: Colors.white.withOpacity(0.5), fit: BoxFit.cover,
fontWeight: FontWeight.w300, ),
fontSize: 16.h), ),
textAlign: TextAlign.end, ),
maxFontSize: 20, ))
), : Container(),
], ],
),
), ),
], ),
); )),
} else { SizedBox(height: 15),
return CupertinoActivityIndicator(); Row(
} crossAxisAlignment: CrossAxisAlignment.end,
})); mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 8,
child: TextScroll(
widget.post.music.artists.first.name!,
style: GoogleFonts.plusJakartaSans(
height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h),
mode: TextScrollMode.endless,
pauseBetween: Duration(milliseconds: 500),
velocity: Velocity(pixelsPerSecond: Offset(20, 0)),
)),
Padding(
padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w),
child: ClipOval(
child: Container(
width: 5.h,
height: 5.h,
color: Colors.white,
),
),
),
Expanded(
flex: 8,
child: Padding(
padding: EdgeInsets.only(bottom: 2),
child: TextScroll(
widget.post.music.title!,
style: GoogleFonts.plusJakartaSans(
height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h),
mode: TextScrollMode.endless,
velocity: Velocity(pixelsPerSecond: Offset(50, 20)),
pauseBetween: Duration(milliseconds: 500),
),
)),
Container(width: 10),
AutoSizeText(
widget.post.music.date.toString(),
style: GoogleFonts.plusJakartaSans(
color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h),
textAlign: TextAlign.end,
maxFontSize: 20,
),
],
),
],
));
}, },
), ),
); );

@ -216,45 +216,52 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: bgColor, backgroundColor: bgColor,
body: Stack( extendBodyBehindAppBar: true,
children: [ body: Container(
CircularRevealAnimation( width: double.infinity,
animation: animation, child: Stack(
centerOffset: Offset(30.w, -100), fit: StackFit.expand,
child: Container( children: [
constraints: BoxConstraints(maxWidth: 600), Align(
padding: EdgeInsets.fromLTRB(defaultPadding, 100.h, defaultPadding, 0), child: CircularRevealAnimation(
child: ListView.builder( animation: animation,
physics: const BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast), centerOffset: Offset(30.w, -100),
clipBehavior: Clip.none, child: Container(
shrinkWrap: true, constraints: BoxConstraints(maxWidth: 600),
itemCount: displayFeed.length, padding: EdgeInsets.fromLTRB(defaultPadding, 100.h, defaultPadding, 0),
itemBuilder: (BuildContext context, int index) { child: ListView.builder(
return Padding( physics: const BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast),
padding: const EdgeInsets.only(bottom: 40), clipBehavior: Clip.none,
child: PostComponent(callback: openDetailPost, post: displayFeed[index], index: index), shrinkWrap: true,
); itemCount: displayFeed.length,
}, itemBuilder: (BuildContext context, int index) {
)), return Padding(
), padding: const EdgeInsets.only(bottom: 40),
IgnorePointer( child: PostComponent(callback: openDetailPost, post: displayFeed[index], index: index),
child: Container( );
height: 240.h, },
decoration: BoxDecoration( )),
gradient: LinearGradient( ),
begin: Alignment.topRight,
stops: [0.3, 1],
colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])),
), ),
), IgnorePointer(
Align( child: Container(
alignment: Alignment.topCenter, height: 100.h,
child: ConstrainedBox( decoration: BoxDecoration(
constraints: BoxConstraints(maxWidth: 800), gradient: LinearGradient(
child: TopNavBarComponent(callback: changeFeed), begin: Alignment.topRight,
stops: [0.3, 1],
colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])),
),
), ),
), Align(
], alignment: Alignment.topCenter,
child: ConstrainedBox(
constraints: BoxConstraints(maxWidth: 800),
child: TopNavBarComponent(callback: changeFeed),
),
),
],
),
), ),
); );
} }

Loading…
Cancel
Save