diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml index 772a2fc..97a88a1 100644 --- a/.idea/libraries/Dart_Packages.xml +++ b/.idea/libraries/Dart_Packages.xml @@ -16,6 +16,13 @@ + + + + + + @@ -742,6 +749,7 @@ + diff --git a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart index 59fe4f6..d411583 100644 --- a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart +++ b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart @@ -1,7 +1,10 @@ +import 'package:another_flushbar/flushbar.dart'; import 'package:auto_size_text/auto_size_text.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; +import 'package:ionicons/ionicons.dart'; +import 'package:zoom_tap_animation/zoom_tap_animation.dart'; import '../config/routes.dart'; import '../values/constants.dart'; @@ -15,13 +18,59 @@ class TopNavBarComponent extends StatefulWidget { State createState() => _TopNavBarComponentState(); } -class _TopNavBarComponentState extends State { +class _TopNavBarComponentState extends State + with TickerProviderStateMixin { bool choice = true; + late AnimationController _controller; void actionSurBouton() { widget.callback(choice); } + @override + void initState() { + _controller = AnimationController( + vsync: this, + duration: Duration(seconds: 3), + ); + super.initState(); + } + + void showCapsuleDot() { + Flushbar( + maxWidth: 210, + animationDuration: Duration(seconds: 1), + forwardAnimationCurve: Curves.easeOutCirc, + margin: EdgeInsets.fromLTRB(0, 0, 0, 0), + icon: Icon( + Ionicons.sparkles, + color: Colors.grey, + size: 22, + ), + padding: EdgeInsets.fromLTRB(8, 8, 8, 8), + messageText: Align( + alignment: Alignment.centerLeft, + child: Text( + "Capsule disponible", + style: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), + ), + ), + flushbarStyle: FlushbarStyle.FLOATING, + flushbarPosition: FlushbarPosition.BOTTOM, + textDirection: Directionality.of(context), + borderRadius: BorderRadius.circular(1000), + borderWidth: 1, + borderColor: Colors.white.withOpacity(0.04), + duration: const Duration(minutes: 100), + leftBarIndicatorColor: Colors.transparent, + positionOffset: 20, + onTap: (_) { + Navigator.pop(context); + Navigator.pushNamed(context, '/post'); + }, + ).show(context); + } + @override Widget build(BuildContext context) { return Padding( @@ -38,11 +87,12 @@ class _TopNavBarComponentState extends State { flex: 1, child: GestureDetector( onTap: () { - Navigator.pushNamed(context, '/post'); + showCapsuleDot(); }, - child: const Image( - image: AssetImage("assets/images/add_friend.png"), - width: 25, + child: const Icon( + Icons.person_add_alt_1_rounded, + color: Colors.white, + size: 30, ), ), ), @@ -51,10 +101,19 @@ class _TopNavBarComponentState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - const Image( - image: AssetImage("assets/images/logo.png"), - height: 30, - ), + ZoomTapAnimation( + enableLongTapRepeatEvent: false, + longTapRepeatDuration: const Duration(milliseconds: 100), + begin: 1.0, + end: 0.97, + beginDuration: const Duration(milliseconds: 70), + endDuration: const Duration(milliseconds: 100), + beginCurve: Curves.decelerate, + endCurve: Curves.easeInOutSine, + child: Image( + image: AssetImage("assets/images/logo.png"), + height: 30, + )), Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -139,7 +198,7 @@ class _TopNavBarComponentState extends State { // Image radius child: const Image( image: AssetImage("assets/images/exemple_profile.png"), - width: 25, + width: 30, ), ), ), diff --git a/Sources/justMUSIC/lib/screens/feed_screen.dart b/Sources/justMUSIC/lib/screens/feed_screen.dart index 97c42e2..00b6680 100644 --- a/Sources/justMUSIC/lib/screens/feed_screen.dart +++ b/Sources/justMUSIC/lib/screens/feed_screen.dart @@ -1,3 +1,4 @@ +import 'package:another_flushbar/flushbar.dart'; import 'package:circular_reveal_animation/circular_reveal_animation.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,8 +17,7 @@ class FeedScreen extends StatefulWidget { State createState() => _FeedScreenState(); } -class _FeedScreenState extends State - with SingleTickerProviderStateMixin { +class _FeedScreenState extends State with TickerProviderStateMixin { late AnimationController animationController; late Animation animation; late List friendFeed; diff --git a/Sources/justMUSIC/lib/screens/search_song_screen.dart b/Sources/justMUSIC/lib/screens/search_song_screen.dart index ae104a6..8186971 100644 --- a/Sources/justMUSIC/lib/screens/search_song_screen.dart +++ b/Sources/justMUSIC/lib/screens/search_song_screen.dart @@ -76,6 +76,12 @@ class _SearchSongScreenState extends State { } } + @override + void dispose() { + MyApp.audioPlayer.pause(); + super.dispose(); + } + @override Widget build(BuildContext context) { double screenHeight = MediaQuery.of(context).size.height; diff --git a/Sources/justMUSIC/pubspec.lock b/Sources/justMUSIC/pubspec.lock index ecf84cd..812bacb 100644 --- a/Sources/justMUSIC/pubspec.lock +++ b/Sources/justMUSIC/pubspec.lock @@ -17,6 +17,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.0.4" + another_flushbar: + dependency: "direct main" + description: + name: another_flushbar + sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" + url: "https://pub.dev" + source: hosted + version: "1.12.30" async: dependency: transitive description: diff --git a/Sources/justMUSIC/pubspec.yaml b/Sources/justMUSIC/pubspec.yaml index 230f3be..2b416f3 100644 --- a/Sources/justMUSIC/pubspec.yaml +++ b/Sources/justMUSIC/pubspec.yaml @@ -64,6 +64,7 @@ dependencies: geolocator: ^9.0.2 tuple: ^2.0.2 firebase_storage: ^11.2.5 + another_flushbar: ^1.12.30 dev_dependencies: flutter_test: