add friend is live !!!

pull/32/head
Lucas Delanier 2 years ago
parent 5c8950a2ad
commit 6e614e2100

@ -0,0 +1 @@
{"nm":"newScene","ddd":0,"h":506,"w":246,"meta":{"g":"LottieFiles Figma v38"},"layers":[{"ty":4,"nm":"","sr":1,"st":0,"op":55,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"ef":[],"shapes":[{"ty":"gr","bm":0,"hd":false,"nm":"","it":[{"ty":"sh","bm":0,"hd":false,"nm":"","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[18.31699999999998,-14.117000000000019],[0,0],[4.924000000000007,-5.552999999999997],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[-2.176000000000016,8.12299999999999],[0,0],[-4.0330000000000155,15.050000000000011],[0,0],[0,0]],"o":[[-15.049000000000007,-4.031999999999982],[0,0],[-8.12299999999999,-2.1759999999999877],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[7.271000000000015,-1.488999999999976],[0,0],[21.383999999999986,-8.803999999999974],[0,0],[0,0],[0,0]],"v":[[229.562,323.522],[173.235,338.521],[161.993,335.509],[142.666,343.701],[136.075,351.133],[146.207,353.848],[156.351,356.566],[164.059,369.916],[171.766,383.266],[169.048,393.41],[166.333,403.542],[176.065,401.551],[192.823,388.908],[195.836,377.666],[236.989,336.385],[239.707,326.24],[229.562,323.522]]}}},{"ty":"sh","bm":0,"hd":false,"nm":"","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[1.0389999999999873,-3.8759999999999764],[3.8770000000000095,1.038000000000011],[-1.0389999999999873,3.8770000000000095],[-3.8770000000000095,-1.0389999999999873]],"o":[[3.8760000000000048,1.038000000000011],[-1.0390000000000157,3.8770000000000095],[-3.8770000000000095,-1.0389999999999873],[1.038000000000011,-3.8770000000000095],[0,0]],"v":[[205.989,339.775],[211.127,348.674],[202.227,353.813],[197.089,344.913],[205.989,339.775]]}}},{"ty":"sh","bm":0,"hd":false,"nm":"","d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,0],[0,0],[-7.138000000000005,4.120999999999981],[0,0],[0,0]],"o":[[0,0],[-6.4269999999999925,3.7110000000000127],[0,0],[0,0],[0,0],[0,0]],"v":[[149.08,369.664],[144.63,372.233],[132.909,387.9],[152.338,385.583],[156.788,383.014],[149.08,369.664]]}}},{"ty":"fl","bm":0,"hd":false,"nm":"","c":{"a":0,"k":[1,1,1]},"r":1,"o":{"a":0,"k":100}},{"ty":"tr","a":{"a":0,"k":[0,0]},"s":{"a":0,"k":[100,100]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[0,0]},"r":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[90],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[90],"t":5},{"s":[0],"t":25}]},"sa":{"a":0,"k":0},"o":{"a":1,"k":[{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":0},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0],"t":5},{"s":[100],"t":25}]}}]}],"ind":1}],"v":"5.7.0","fr":60,"op":55,"ip":0,"assets":[]}

@ -1,4 +1,5 @@
import 'package:flutter/Material.dart'; import 'package:flutter/Material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import '../main.dart'; import '../main.dart';
import '../model/User.dart'; import '../model/User.dart';
@ -82,6 +83,17 @@ class _ProfileListComponentState extends State<ProfileListComponent> {
splashColor: Colors.white.withOpacity(0.3), splashColor: Colors.white.withOpacity(0.3),
onTap: () async { onTap: () async {
await MyApp.userViewModel.addOrDeleteFriend(widget.user.id); await MyApp.userViewModel.addOrDeleteFriend(widget.user.id);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
"Vous ne suivez plus ${widget.user.pseudo}",
style: GoogleFonts.plusJakartaSans(
color: Colors.white, fontWeight: FontWeight.w400, fontSize: 20.h),
),
backgroundColor: Colors.red,
closeIconColor: Colors.white,
),
);
setState(() {}); setState(() {});
}, },
child: Container( child: Container(
@ -100,6 +112,16 @@ class _ProfileListComponentState extends State<ProfileListComponent> {
splashColor: Colors.white.withOpacity(0.3), splashColor: Colors.white.withOpacity(0.3),
onTap: () async { onTap: () async {
await MyApp.userViewModel.addOrDeleteFriend(widget.user.id); await MyApp.userViewModel.addOrDeleteFriend(widget.user.id);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
backgroundColor: primaryColor,
content: Text(
"Vous suivez à present ${widget.user.pseudo}",
style: GoogleFonts.plusJakartaSans(
color: Colors.white, fontWeight: FontWeight.w400, fontSize: 20.h),
),
),
);
setState(() {}); setState(() {});
}, },
child: Container( child: Container(

@ -138,10 +138,7 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> with TickerProv
child: GestureDetector( child: GestureDetector(
behavior: HitTestBehavior.translucent, behavior: HitTestBehavior.translucent,
onTap: () async { onTap: () async {
bool returnFromOtherPage = await Navigator.of(context).push(routeAddFriend()); Navigator.of(context).push(routeAddFriend());
if (returnFromOtherPage == true) {
checkAvailable();
}
}, },
child: const Icon( child: const Icon(
Icons.person_add_alt_1_rounded, Icons.person_add_alt_1_rounded,
@ -159,7 +156,9 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> with TickerProv
enableLongTapRepeatEvent: false, enableLongTapRepeatEvent: false,
longTapRepeatDuration: const Duration(milliseconds: 100), longTapRepeatDuration: const Duration(milliseconds: 100),
begin: 1.0, begin: 1.0,
onTap: () {}, onTap: () {
Navigator.of(context).pushNamed('/launchingRocket');
},
end: 0.97, end: 0.97,
beginDuration: const Duration(milliseconds: 70), beginDuration: const Duration(milliseconds: 70),
endDuration: const Duration(milliseconds: 100), endDuration: const Duration(milliseconds: 100),
@ -238,19 +237,16 @@ class _TopNavBarComponentState extends State<TopNavBarComponent> with TickerProv
child: GestureDetector( child: GestureDetector(
onTap: () async { onTap: () async {
await MyApp.userViewModel.updateUserCurrent(); await MyApp.userViewModel.updateUserCurrent();
bool returnFromOtherPage = await Navigator.of(context).push(routeProfile()); Navigator.of(context).push(routeProfile());
if (returnFromOtherPage == true) {
checkAvailable();
}
}, },
child: ClipOval( child: ClipOval(
child: SizedBox.fromSize( child: SizedBox.fromSize(
// Image radius // Image radius
child: Image( child: FadeInImage.assetNetwork(
image: NetworkImage(MyApp.userViewModel.userCurrent.pp), placeholder: 'assets/images/loadingPlaceholder.gif',
image: MyApp.userViewModel.userCurrent.pp,
width: 30, width: 30,
), )),
),
), ),
), ),
) )

@ -8,6 +8,7 @@ import 'package:justmusic/screens/add_friend_screen.dart';
import 'package:justmusic/screens/explanations_screen.dart'; import 'package:justmusic/screens/explanations_screen.dart';
import 'package:justmusic/screens/feed_screen.dart'; import 'package:justmusic/screens/feed_screen.dart';
import 'package:justmusic/screens/login_screen.dart'; import 'package:justmusic/screens/login_screen.dart';
import 'package:justmusic/screens/launching_rocker_screen.dart';
import 'package:justmusic/screens/post_screen.dart'; import 'package:justmusic/screens/post_screen.dart';
import 'package:justmusic/screens/profile_screen.dart'; import 'package:justmusic/screens/profile_screen.dart';
import 'package:justmusic/screens/registration_screen.dart'; import 'package:justmusic/screens/registration_screen.dart';
@ -53,6 +54,7 @@ class MyApp extends StatelessWidget {
'/profile': (context) => const ProfileScreen(), '/profile': (context) => const ProfileScreen(),
'/explanation': (context) => const ExplanationsScreen(), '/explanation': (context) => const ExplanationsScreen(),
'/addFriend': (context) => const AddFriendScreen(), '/addFriend': (context) => const AddFriendScreen(),
'/launchingRocket': (context) => const LaunchingRocketScreen(),
}, },
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
theme: ThemeData( theme: ThemeData(

@ -0,0 +1,43 @@
import 'package:flutter/Material.dart';
import 'package:lottie/lottie.dart';
class LaunchingRocketScreen extends StatefulWidget {
const LaunchingRocketScreen({super.key});
@override
State<LaunchingRocketScreen> createState() => _LaunchingRocketScreenState();
}
class _LaunchingRocketScreenState extends State<LaunchingRocketScreen> with TickerProviderStateMixin {
late final AnimationController _controller;
@override
initState() {
_controller = AnimationController(vsync: this, duration: Duration(seconds: 3));
super.initState();
}
@override
Widget build(BuildContext context) {
return Stack(
fit: StackFit.expand,
children: [
Align(
alignment: Alignment.topCenter,
child: Lottie.asset(
'assets/animations/rocket.json',
width: double.infinity,
frameRate: FrameRate(60),
fit: BoxFit.contain,
controller: _controller,
onLoaded: (composition) {
// Configure the AnimationController with the duration of the
// Lottie file and start the animation.
_controller.forward();
},
),
),
],
);
}
}
Loading…
Cancel
Save