|
|
@ -17,7 +17,8 @@ class FeedScreen extends StatefulWidget {
|
|
|
|
State<FeedScreen> createState() => _FeedScreenState();
|
|
|
|
State<FeedScreen> createState() => _FeedScreenState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateMixin {
|
|
|
|
class _FeedScreenState extends State<FeedScreen>
|
|
|
|
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
late AnimationController animationController;
|
|
|
|
late AnimationController animationController;
|
|
|
|
late Animation<double> animation;
|
|
|
|
late Animation<double> animation;
|
|
|
|
late List<Post> friendFeed;
|
|
|
|
late List<Post> friendFeed;
|
|
|
@ -85,7 +86,8 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
isScrollControlled: true,
|
|
|
|
isScrollControlled: true,
|
|
|
|
context: context,
|
|
|
|
context: context,
|
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
|
shape: const RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))),
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
|
|
|
topLeft: Radius.circular(20), topRight: Radius.circular(20))),
|
|
|
|
builder: ((BuildContext context) {
|
|
|
|
builder: ((BuildContext context) {
|
|
|
|
return GestureDetector(
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
@ -104,19 +106,24 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
width: 60,
|
|
|
|
width: 60,
|
|
|
|
height: 5,
|
|
|
|
height: 5,
|
|
|
|
decoration:
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
BoxDecoration(color: Colors.white.withOpacity(0.3), borderRadius: BorderRadius.circular(20))),
|
|
|
|
color: Colors.white.withOpacity(0.3),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(20))),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
const SizedBox(
|
|
|
|
height: 20,
|
|
|
|
height: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
Expanded(
|
|
|
|
child: ClipRRect(
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius: BorderRadius.only(topRight: Radius.circular(15), topLeft: Radius.circular(15)),
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
|
|
|
|
topRight: Radius.circular(15),
|
|
|
|
|
|
|
|
topLeft: Radius.circular(15)),
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: defaultPadding, right: defaultPadding),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
left: defaultPadding, right: defaultPadding),
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
physics: BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast),
|
|
|
|
physics: BouncingScrollPhysics(
|
|
|
|
|
|
|
|
decelerationRate: ScrollDecelerationRate.fast),
|
|
|
|
child: Wrap(
|
|
|
|
child: Wrap(
|
|
|
|
// to apply margin in the main axis of the wrap
|
|
|
|
// to apply margin in the main axis of the wrap
|
|
|
|
runSpacing: 10,
|
|
|
|
runSpacing: 10,
|
|
|
@ -131,21 +138,25 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
? Container()
|
|
|
|
? Container()
|
|
|
|
: Padding(
|
|
|
|
: Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 20),
|
|
|
|
padding: const EdgeInsets.only(bottom: 20),
|
|
|
|
child: Text('${displayFeed[index].description ?? ""}',
|
|
|
|
child: Text(
|
|
|
|
|
|
|
|
'${displayFeed[index].description ?? ""}',
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
color: Colors.white, fontWeight: FontWeight.w200)),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w200)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Align(
|
|
|
|
Align(
|
|
|
|
child: RichText(
|
|
|
|
child: RichText(
|
|
|
|
text: TextSpan(
|
|
|
|
text: TextSpan(
|
|
|
|
text: "3",
|
|
|
|
text: "3",
|
|
|
|
style:
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
TextSpan(
|
|
|
|
text: " commentaires",
|
|
|
|
text: " commentaires",
|
|
|
|
style:
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w300),
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w300),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
])),
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -161,12 +172,15 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
|
|
|
bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
height: 70,
|
|
|
|
height: 70,
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(top: BorderSide(color: grayColor, width: 2)), color: textFieldMessage),
|
|
|
|
border: Border(
|
|
|
|
|
|
|
|
top: BorderSide(color: grayColor, width: 2)),
|
|
|
|
|
|
|
|
color: textFieldMessage),
|
|
|
|
child: Center(
|
|
|
|
child: Center(
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 20),
|
|
|
@ -176,7 +190,8 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
child: SizedBox.fromSize(
|
|
|
|
child: SizedBox.fromSize(
|
|
|
|
// Image radius
|
|
|
|
// Image radius
|
|
|
|
child: const Image(
|
|
|
|
child: const Image(
|
|
|
|
image: AssetImage("assets/images/exemple_profile.png"),
|
|
|
|
image: AssetImage(
|
|
|
|
|
|
|
|
"assets/images/exemple_profile.png"),
|
|
|
|
width: 45,
|
|
|
|
width: 45,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -189,7 +204,8 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
keyboardAppearance: Brightness.dark,
|
|
|
|
keyboardAppearance: Brightness.dark,
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
cursorColor: primaryColor,
|
|
|
|
keyboardType: TextInputType.emailAddress,
|
|
|
|
keyboardType: TextInputType.emailAddress,
|
|
|
|
style: GoogleFonts.plusJakartaSans(color: Colors.white),
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
|
|
|
|
color: Colors.white),
|
|
|
|
decoration: InputDecoration(
|
|
|
|
decoration: InputDecoration(
|
|
|
|
suffixIcon: Icon(
|
|
|
|
suffixIcon: Icon(
|
|
|
|
Icons.send,
|
|
|
|
Icons.send,
|
|
|
@ -197,17 +213,27 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
size: 20,
|
|
|
|
size: 20,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide(width: 1, color: grayText),
|
|
|
|
borderSide: BorderSide(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(100))),
|
|
|
|
width: 1, color: grayText),
|
|
|
|
contentPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20),
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
|
|
|
Radius.circular(100))),
|
|
|
|
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
|
|
|
|
top: 0,
|
|
|
|
|
|
|
|
bottom: 0,
|
|
|
|
|
|
|
|
left: 20,
|
|
|
|
|
|
|
|
right: 20),
|
|
|
|
fillColor: bgModal,
|
|
|
|
fillColor: bgModal,
|
|
|
|
filled: true,
|
|
|
|
filled: true,
|
|
|
|
focusColor: Color.fromRGBO(255, 255, 255, 0.30),
|
|
|
|
focusColor:
|
|
|
|
|
|
|
|
Color.fromRGBO(255, 255, 255, 0.30),
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide(width: 1, color: grayText),
|
|
|
|
borderSide: BorderSide(
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(100))),
|
|
|
|
width: 1, color: grayText),
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
|
|
|
|
Radius.circular(100))),
|
|
|
|
hintText: 'Ajoutez une réponse...',
|
|
|
|
hintText: 'Ajoutez une réponse...',
|
|
|
|
hintStyle: GoogleFonts.plusJakartaSans(color: grayText)),
|
|
|
|
hintStyle: GoogleFonts.plusJakartaSans(
|
|
|
|
|
|
|
|
color: grayText)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
@ -238,16 +264,21 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
Container(
|
|
|
|
Container(
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
decoration: const BoxDecoration(
|
|
|
|
image: DecorationImage(
|
|
|
|
image: DecorationImage(
|
|
|
|
image: AssetImage("assets/images/empty_bg.png"), fit: BoxFit.cover, opacity: 0.3),
|
|
|
|
image: AssetImage("assets/images/empty_bg.png"),
|
|
|
|
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
|
|
|
|
opacity: 0.3),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(top: 140.h, left: defaultPadding),
|
|
|
|
padding:
|
|
|
|
|
|
|
|
EdgeInsets.only(top: 140.h, left: defaultPadding),
|
|
|
|
child: Column(
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Text("Suis tes amis pour voir leurs capsules",
|
|
|
|
Text("Suis tes amis pour voir leurs capsules",
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
color: Colors.white, fontSize: 23, fontWeight: FontWeight.w800))
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontSize: 23,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.w800))
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -260,8 +291,14 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
stops: [0.3, 1],
|
|
|
|
stops: [
|
|
|
|
colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])),
|
|
|
|
0.3,
|
|
|
|
|
|
|
|
1
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
colors: [
|
|
|
|
|
|
|
|
bgColor.withOpacity(0.9),
|
|
|
|
|
|
|
|
bgColor.withOpacity(0)
|
|
|
|
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -281,26 +318,32 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
fit: StackFit.expand,
|
|
|
|
fit: StackFit.expand,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Align(
|
|
|
|
Align(
|
|
|
|
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: CircularRevealAnimation(
|
|
|
|
child: CircularRevealAnimation(
|
|
|
|
animation: animation,
|
|
|
|
animation: animation,
|
|
|
|
centerOffset: Offset(30.w, -100),
|
|
|
|
centerOffset: Offset(30.w, -100),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
constraints: BoxConstraints(maxWidth: 600),
|
|
|
|
constraints: BoxConstraints(maxWidth: 600),
|
|
|
|
padding: EdgeInsets.fromLTRB(defaultPadding, 100.h, defaultPadding, 0),
|
|
|
|
padding: EdgeInsets.fromLTRB(
|
|
|
|
|
|
|
|
defaultPadding, 100.h, defaultPadding, 0),
|
|
|
|
child: RefreshIndicator(
|
|
|
|
child: RefreshIndicator(
|
|
|
|
displacement: 20,
|
|
|
|
displacement: 20,
|
|
|
|
triggerMode: RefreshIndicatorTriggerMode.onEdge,
|
|
|
|
triggerMode: RefreshIndicatorTriggerMode.onEdge,
|
|
|
|
onRefresh: _refresh,
|
|
|
|
onRefresh: _refresh,
|
|
|
|
child: ListView.builder(
|
|
|
|
child: ListView.builder(
|
|
|
|
physics: const BouncingScrollPhysics(decelerationRate: ScrollDecelerationRate.fast),
|
|
|
|
physics: const BouncingScrollPhysics(
|
|
|
|
|
|
|
|
decelerationRate:
|
|
|
|
|
|
|
|
ScrollDecelerationRate.fast),
|
|
|
|
clipBehavior: Clip.none,
|
|
|
|
clipBehavior: Clip.none,
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: displayFeed.length,
|
|
|
|
itemCount: displayFeed.length,
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
return Padding(
|
|
|
|
return Padding(
|
|
|
|
padding: const EdgeInsets.only(bottom: 40),
|
|
|
|
padding: const EdgeInsets.only(bottom: 40),
|
|
|
|
child:
|
|
|
|
child: PostComponent(
|
|
|
|
PostComponent(callback: openDetailPost, post: displayFeed[index], index: index),
|
|
|
|
callback: openDetailPost,
|
|
|
|
|
|
|
|
post: displayFeed[index],
|
|
|
|
|
|
|
|
index: index),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -315,8 +358,14 @@ class _FeedScreenState extends State<FeedScreen> with SingleTickerProviderStateM
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
gradient: LinearGradient(
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
begin: Alignment.topRight,
|
|
|
|
stops: [0.3, 1],
|
|
|
|
stops: [
|
|
|
|
colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])),
|
|
|
|
0.3,
|
|
|
|
|
|
|
|
1
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
colors: [
|
|
|
|
|
|
|
|
bgColor.withOpacity(0.9),
|
|
|
|
|
|
|
|
bgColor.withOpacity(0)
|
|
|
|
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|