|
|
@ -8,6 +8,8 @@ import 'package:google_fonts/google_fonts.dart';
|
|
|
|
import '../components/comment_component.dart';
|
|
|
|
import '../components/comment_component.dart';
|
|
|
|
import '../components/post_component.dart';
|
|
|
|
import '../components/post_component.dart';
|
|
|
|
import '../components/top_nav_bar_component.dart';
|
|
|
|
import '../components/top_nav_bar_component.dart';
|
|
|
|
|
|
|
|
import '../main.dart';
|
|
|
|
|
|
|
|
import '../model/Post.dart';
|
|
|
|
import '../values/constants.dart';
|
|
|
|
import '../values/constants.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class FeedScreen extends StatefulWidget {
|
|
|
|
class FeedScreen extends StatefulWidget {
|
|
|
@ -20,27 +22,15 @@ class FeedScreen extends StatefulWidget {
|
|
|
|
class _FeedScreenState extends State<FeedScreen> with TickerProviderStateMixin {
|
|
|
|
class _FeedScreenState extends State<FeedScreen> with TickerProviderStateMixin {
|
|
|
|
late AnimationController animationController;
|
|
|
|
late AnimationController animationController;
|
|
|
|
late Animation<double> animation;
|
|
|
|
late Animation<double> animation;
|
|
|
|
late List<PostComponent> friendFeed;
|
|
|
|
late List<Post> friendFeed;
|
|
|
|
late List<PostComponent> discoveryFeed;
|
|
|
|
late List<Post> discoveryFeed;
|
|
|
|
late List<PostComponent> displayFeed;
|
|
|
|
late List<Post> displayFeed;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
friendFeed = [
|
|
|
|
friendFeed = [];
|
|
|
|
PostComponent(
|
|
|
|
discoveryFeed = MyApp.postViewModel.bestPosts;
|
|
|
|
callback: openDetailPost,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
PostComponent(
|
|
|
|
|
|
|
|
callback: openDetailPost,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
PostComponent(
|
|
|
|
|
|
|
|
callback: openDetailPost,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
discoveryFeed = [
|
|
|
|
|
|
|
|
PostComponent(callback: openDetailPost),
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
displayFeed = friendFeed;
|
|
|
|
displayFeed = friendFeed;
|
|
|
|
animationController = AnimationController(
|
|
|
|
animationController = AnimationController(
|
|
|
|
vsync: this,
|
|
|
|
vsync: this,
|
|
|
@ -140,13 +130,13 @@ class _FeedScreenState extends State<FeedScreen> with TickerProviderStateMixin {
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
fontWeight: FontWeight.w600),
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
TextSpan(
|
|
|
|
TextSpan(
|
|
|
|
text: " commentaires",
|
|
|
|
text: " commentaires",
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
style: GoogleFonts.plusJakartaSans(
|
|
|
|
color: Colors.white,
|
|
|
|
color: Colors.white,
|
|
|
|
fontWeight: FontWeight.w300),
|
|
|
|
fontWeight: FontWeight.w300),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
])),
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
SizedBox(height: 20),
|
|
|
|
CommentComponent(),
|
|
|
|
CommentComponent(),
|
|
|
@ -161,7 +151,10 @@ class _FeedScreenState extends State<FeedScreen> with TickerProviderStateMixin {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Padding(
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
bottom: MediaQuery
|
|
|
|
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.viewInsets
|
|
|
|
|
|
|
|
.bottom),
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
height: 70,
|
|
|
|
height: 70,
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
@ -213,7 +206,7 @@ class _FeedScreenState extends State<FeedScreen> with TickerProviderStateMixin {
|
|
|
|
fillColor: bgModal,
|
|
|
|
fillColor: bgModal,
|
|
|
|
filled: true,
|
|
|
|
filled: true,
|
|
|
|
focusColor:
|
|
|
|
focusColor:
|
|
|
|
Color.fromRGBO(255, 255, 255, 0.30),
|
|
|
|
Color.fromRGBO(255, 255, 255, 0.30),
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
borderSide: BorderSide(
|
|
|
|
width: 1, color: grayText),
|
|
|
|
width: 1, color: grayText),
|
|
|
@ -263,9 +256,12 @@ class _FeedScreenState extends State<FeedScreen> with TickerProviderStateMixin {
|
|
|
|
child: Padding(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(top: 100.h),
|
|
|
|
padding: EdgeInsets.only(top: 100.h),
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Wrap(
|
|
|
|
child: ListView.builder(
|
|
|
|
runSpacing: 60,
|
|
|
|
itemBuilder: (BuildContext context,
|
|
|
|
children: displayFeed,
|
|
|
|
int index) {
|
|
|
|
|
|
|
|
return PostComponent(callback: openDetailPost,);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -279,12 +275,12 @@ class _FeedScreenState extends State<FeedScreen> with TickerProviderStateMixin {
|
|
|
|
height: 240.h,
|
|
|
|
height: 240.h,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: LinearGradient(begin: Alignment.topRight, stops: [
|
|
|
|
gradient: LinearGradient(begin: Alignment.topRight, stops: [
|
|
|
|
0.3,
|
|
|
|
0.3,
|
|
|
|
1
|
|
|
|
1
|
|
|
|
], colors: [
|
|
|
|
], colors: [
|
|
|
|
bgColor.withOpacity(0.9),
|
|
|
|
bgColor.withOpacity(0.9),
|
|
|
|
bgColor.withOpacity(0)
|
|
|
|
bgColor.withOpacity(0)
|
|
|
|
])),
|
|
|
|
])),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Align(
|
|
|
|
Align(
|
|
|
|