|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
import 'package:circular_reveal_animation/circular_reveal_animation.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
@ -13,7 +14,10 @@ class FeedScreen extends StatefulWidget {
|
|
|
|
State<FeedScreen> createState() => _FeedScreenState();
|
|
|
|
State<FeedScreen> createState() => _FeedScreenState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _FeedScreenState extends State<FeedScreen> {
|
|
|
|
class _FeedScreenState extends State<FeedScreen>
|
|
|
|
|
|
|
|
with SingleTickerProviderStateMixin {
|
|
|
|
|
|
|
|
late AnimationController animationController;
|
|
|
|
|
|
|
|
late Animation<double> animation;
|
|
|
|
List<PostComponent> friendFeed = [
|
|
|
|
List<PostComponent> friendFeed = [
|
|
|
|
PostComponent(),
|
|
|
|
PostComponent(),
|
|
|
|
PostComponent(),
|
|
|
|
PostComponent(),
|
|
|
@ -26,19 +30,32 @@ class _FeedScreenState extends State<FeedScreen> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
displayFeed = friendFeed;
|
|
|
|
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
displayFeed = friendFeed;
|
|
|
|
|
|
|
|
animationController = AnimationController(
|
|
|
|
|
|
|
|
vsync: this,
|
|
|
|
|
|
|
|
duration: Duration(milliseconds: 400),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
animation = CurvedAnimation(
|
|
|
|
|
|
|
|
parent: animationController,
|
|
|
|
|
|
|
|
curve: Curves.easeInOutSine,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
animationController.forward();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void changeFeed(bool choice) {
|
|
|
|
void changeFeed(bool choice) {
|
|
|
|
// Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre
|
|
|
|
// Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre
|
|
|
|
if (choice) {
|
|
|
|
if (choice) {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
animationController.reset();
|
|
|
|
displayFeed = friendFeed;
|
|
|
|
displayFeed = friendFeed;
|
|
|
|
|
|
|
|
animationController.forward();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
|
|
|
|
animationController.reset();
|
|
|
|
displayFeed = discoveryFeed;
|
|
|
|
displayFeed = discoveryFeed;
|
|
|
|
|
|
|
|
animationController.forward();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -49,7 +66,11 @@ class _FeedScreenState extends State<FeedScreen> {
|
|
|
|
backgroundColor: bgColor,
|
|
|
|
backgroundColor: bgColor,
|
|
|
|
body: Stack(
|
|
|
|
body: Stack(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SingleChildScrollView(
|
|
|
|
CircularRevealAnimation(
|
|
|
|
|
|
|
|
animation: animation,
|
|
|
|
|
|
|
|
// centerAlignment: Alignment.centerRight,
|
|
|
|
|
|
|
|
centerOffset: Offset(70, 0),
|
|
|
|
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: SizedBox(
|
|
|
|
child: SizedBox(
|
|
|
|
width: double.infinity,
|
|
|
|
width: double.infinity,
|
|
|
|
child: Align(
|
|
|
|
child: Align(
|
|
|
@ -73,6 +94,7 @@ class _FeedScreenState extends State<FeedScreen> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
IgnorePointer(
|
|
|
|
IgnorePointer(
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
height: 240.h,
|
|
|
|
height: 240.h,
|
|
|
|