diff --git a/Sources/justMUSIC/android/app/build.gradle b/Sources/justMUSIC/android/app/build.gradle index 97e5ae2..f318bc7 100644 --- a/Sources/justMUSIC/android/app/build.gradle +++ b/Sources/justMUSIC/android/app/build.gradle @@ -24,6 +24,7 @@ if (flutterVersionName == null) { apply plugin: 'com.android.application' apply plugin: 'kotlin-android' +apply plugin: 'com.google.gms.google-services' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { diff --git a/Sources/justMUSIC/lib/components/comment_component.dart b/Sources/justMUSIC/lib/components/comment_component.dart index c83463b..7743f8c 100644 --- a/Sources/justMUSIC/lib/components/comment_component.dart +++ b/Sources/justMUSIC/lib/components/comment_component.dart @@ -8,6 +8,7 @@ import '../values/constants.dart'; class CommentComponent extends StatelessWidget { final Comment comment; + const CommentComponent({Key? key, required this.comment}) : super(key: key); @override @@ -17,7 +18,9 @@ class CommentComponent extends StatelessWidget { return Container( width: double.infinity, - decoration: BoxDecoration(color: bgComment.withOpacity(0.6), borderRadius: BorderRadius.circular(15)), + decoration: BoxDecoration( + color: bgComment.withOpacity(0.6), + borderRadius: BorderRadius.circular(15)), padding: EdgeInsets.fromLTRB(20, 10, 20, 10), margin: EdgeInsets.only(bottom: 13), child: Row( @@ -46,14 +49,17 @@ class CommentComponent extends StatelessWidget { ), Text( comment.user.pseudo, - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontWeight: FontWeight.w600), ), Padding( padding: EdgeInsets.only(top: 6, left: 10), child: Text( "il y a ${difference.inHours > 0 ? difference.inHours : difference.inMinutes}${difference.inHours > 0 ? "h" : "m"}", style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.6), fontWeight: FontWeight.w400, fontSize: 10), + color: Colors.white.withOpacity(0.6), + fontWeight: FontWeight.w400, + fontSize: 10), ), ), ], @@ -65,7 +71,10 @@ class CommentComponent extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 10), child: Text( comment.text, - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w400, fontSize: 15), + style: GoogleFonts.plusJakartaSans( + color: Colors.white, + fontWeight: FontWeight.w400, + fontSize: 15), ), ), ], diff --git a/Sources/justMUSIC/lib/components/post_component.dart b/Sources/justMUSIC/lib/components/post_component.dart index 4b1b9a2..4c912e5 100644 --- a/Sources/justMUSIC/lib/components/post_component.dart +++ b/Sources/justMUSIC/lib/components/post_component.dart @@ -1,438 +1,438 @@ -import 'package:auto_size_text/auto_size_text.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:gradient_borders/box_borders/gradient_box_border.dart'; -import 'package:text_scroll/text_scroll.dart'; -import 'package:zoom_tap_animation/zoom_tap_animation.dart'; - -import '../model/Post.dart'; - -class PostComponent extends StatefulWidget { - final Function(int)? callback; - final Post post; - final int index; - - PostComponent({Key? key, required this.callback, required this.post, required this.index}) : super(key: key); - - @override - State createState() => _PostComponentState(); -} - -class _PostComponentState extends State with TickerProviderStateMixin { - bool choice = false; - DateTime today = DateTime.now(); - - void switchChoice() { - setState(() { - choice = !choice; - }); - } - - @override - void initState() { - print("post: ${widget.post.date.toString()}"); - print("ajrd: ${DateTime.now().toString()}"); - super.initState(); - } - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: switchChoice, - child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { - if (widget.callback == null) { - return SizedBox( - width: double.infinity, - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image( - image: NetworkImage(widget.post.user.pp), - width: 40, - ), - ), - ), - Expanded( - flex: 8, - child: Padding( - padding: const EdgeInsets.only(left: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.post.user.pseudo, - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), - ), - widget.post.location.item2 != null - ? Text( - "${widget.post.location.item1}, ${widget.post.location.item2}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - : Text( - "", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - ], - ), - ), - ), - DateTime(today.year, today.month, today.day).isAtSameMomentAs( - DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) - ? Text( - "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ) - : Text( - "${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ), - ], - ), - SizedBox(height: 10), - ZoomTapAnimation( - onTap: () { - if (widget.post.selfie != null) { - switchChoice(); - } - }, - enableLongTapRepeatEvent: false, - longTapRepeatDuration: const Duration(milliseconds: 100), - begin: 1.0, - end: 0.99, - beginDuration: const Duration(milliseconds: 70), - endDuration: const Duration(milliseconds: 100), - beginCurve: Curves.decelerate, - endCurve: Curves.easeInOutSine, - child: AspectRatio( - aspectRatio: 1 / 1, - child: Container( - decoration: BoxDecoration( - // add border - border: const GradientBoxBorder( - gradient: LinearGradient(colors: [ - Colors.transparent, - Color(0xFF323232), - ], begin: Alignment.topCenter, end: Alignment.bottomCenter), - width: 2.5, - ), - // set border radius - borderRadius: BorderRadius.circular(20), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(18), - // implement image - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Image( - image: NetworkImage(choice ? widget.post.selfie! : widget.post.music.cover!), - fit: BoxFit.cover, - width: double.infinity, - ), - widget.post.selfie != null - ? Positioned( - top: 0, - right: 0, - child: Padding( - padding: EdgeInsets.all(12), - child: Container( - constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), - width: 90.sp, - height: 90.sp, - decoration: BoxDecoration( - color: Colors.white, - // add border - border: Border.all(width: 3, color: Colors.white), - // set border radius - borderRadius: BorderRadius.circular(15), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(13), - // implement image - child: Image( - image: NetworkImage( - choice ? widget.post.music.cover! : widget.post.selfie!), - fit: BoxFit.cover, - ), - ), - ), - )) - : Container(), - ], - ), - ), - ), - )), - SizedBox(height: 15), - Row( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Flexible( - flex: 8, - child: TextScroll( - widget.post.music.artists.first.name!, - style: GoogleFonts.plusJakartaSans( - height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0)), - )), - Padding( - padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w), - child: ClipOval( - child: Container( - width: 5.h, - height: 5.h, - color: Colors.white, - ), - ), - ), - Expanded( - flex: 8, - child: Padding( - padding: EdgeInsets.only(bottom: 2), - child: TextScroll( - widget.post.music.title!, - style: GoogleFonts.plusJakartaSans( - height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h), - mode: TextScrollMode.endless, - velocity: Velocity(pixelsPerSecond: Offset(50, 20)), - pauseBetween: Duration(milliseconds: 500), - ), - )), - Container(width: 10), - AutoSizeText( - widget.post.music.date.toString(), - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h), - textAlign: TextAlign.end, - maxFontSize: 20, - ), - ], - ), - ], - )); - } - - return SizedBox( - width: double.infinity, - child: Column( - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image( - image: NetworkImage(widget.post.user.pp), - width: 40, - ), - ), - ), - Expanded( - flex: 8, - child: Padding( - padding: const EdgeInsets.only(left: 10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - widget.post.user.pseudo, - style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), - ), - widget.post.location.item2 != null - ? Text( - "${widget.post.location.item1}, ${widget.post.location.item2}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - : Text( - "", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, - fontSize: 13), - ) - ], - ), - ), - ), - DateTime(today.year, today.month, today.day).isAtSameMomentAs( - DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) - ? Text( - "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ) - : Text( - "hier, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), - ), - ], - ), - SizedBox(height: 10), - ZoomTapAnimation( - onTap: () { - widget.callback!(widget.index); - }, - enableLongTapRepeatEvent: false, - longTapRepeatDuration: const Duration(milliseconds: 100), - begin: 1.0, - end: 0.99, - beginDuration: const Duration(milliseconds: 70), - endDuration: const Duration(milliseconds: 100), - beginCurve: Curves.decelerate, - endCurve: Curves.easeInOutSine, - child: AspectRatio( - aspectRatio: 1 / 1, - child: Container( - decoration: BoxDecoration( - // add border - border: const GradientBoxBorder( - gradient: LinearGradient(colors: [ - Colors.transparent, - Color(0xFF323232), - ], begin: Alignment.topCenter, end: Alignment.bottomCenter), - width: 2.5, - ), - // set border radius - borderRadius: BorderRadius.circular(20), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(18), - // implement image - child: Stack( - alignment: Alignment.bottomCenter, - children: [ - Image( - image: NetworkImage(widget.post.music.cover!), - fit: BoxFit.cover, - width: double.infinity, - ), - Image( - image: AssetImage("assets/images/shadow_post.png"), - opacity: AnimationController(vsync: this, value: 0.7), - fit: BoxFit.fitHeight, - width: double.infinity, - ), - widget.post.description == null - ? Container() - : Padding( - padding: EdgeInsets.all(15), - child: AutoSizeText( - '“${widget.post.description}”', - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontWeight: FontWeight.w400, fontSize: 15.sp), - maxFontSize: 20, - maxLines: 1, - ), - ), - widget.post.selfie != null - ? Positioned( - top: 0, - right: 0, - child: Padding( - padding: EdgeInsets.all(12), - child: Container( - constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), - width: 90.sp, - height: 90.sp, - decoration: BoxDecoration( - color: Colors.white, - // add border - border: Border.all(width: 3, color: Colors.white), - // set border radius - borderRadius: BorderRadius.circular(15), - ), - child: ClipRRect( - borderRadius: BorderRadius.circular(13), - // implement image - child: Image( - image: NetworkImage(widget.post.selfie!), - fit: BoxFit.cover, - ), - ), - ), - )) - : Container(), - ], - ), - ), - ), - )), - SizedBox(height: 15), - SizedBox( - height: 60, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 8, - child: Padding( - padding: EdgeInsets.only(bottom: 2), - child: TextScroll( - widget.post.music.title!, - style: GoogleFonts.plusJakartaSans( - height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), - mode: TextScrollMode.endless, - velocity: Velocity(pixelsPerSecond: Offset(50, 20)), - pauseBetween: Duration(milliseconds: 500), - ), - )), - Container(width: 10), - AutoSizeText( - widget.post.music.date.toString(), - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), - textAlign: TextAlign.end, - maxFontSize: 20, - ), - ], - ), - Expanded( - flex: 8, - child: TextScroll( - widget.post.music.artists.first.name!, - style: GoogleFonts.plusJakartaSans( - height: 1, - color: Colors.white.withOpacity(0.5), - fontWeight: FontWeight.w300, - fontSize: 16.h), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0)), - )), - ], - ), - ) - ], - )); - }, - ), - ); - } -} +import 'package:auto_size_text/auto_size_text.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:gradient_borders/box_borders/gradient_box_border.dart'; +import 'package:text_scroll/text_scroll.dart'; +import 'package:zoom_tap_animation/zoom_tap_animation.dart'; + +import '../model/Post.dart'; + +class PostComponent extends StatefulWidget { + final Function(int)? callback; + final Post post; + final int index; + + PostComponent({Key? key, required this.callback, required this.post, required this.index}) : super(key: key); + + @override + State createState() => _PostComponentState(); +} + +class _PostComponentState extends State with TickerProviderStateMixin { + bool choice = false; + DateTime today = DateTime.now(); + + void switchChoice() { + setState(() { + choice = !choice; + }); + } + + @override + void initState() { + print("post: ${widget.post.date.toString()}"); + print("ajrd: ${DateTime.now().toString()}"); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: switchChoice, + child: LayoutBuilder( + builder: (BuildContext context, BoxConstraints constraints) { + if (widget.callback == null) { + return SizedBox( + width: double.infinity, + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image( + image: NetworkImage(widget.post.user.pp), + width: 40, + ), + ), + ), + Expanded( + flex: 8, + child: Padding( + padding: const EdgeInsets.only(left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.post.user.pseudo, + style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), + ), + widget.post.location.item2 != null + ? Text( + "${widget.post.location.item1}, ${widget.post.location.item2}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + : Text( + "", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + ], + ), + ), + ), + DateTime(today.year, today.month, today.day).isAtSameMomentAs( + DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) + ? Text( + "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ) + : Text( + "${widget.post.date.day}/${widget.post.date.month}/${widget.post.date.year}-${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ), + ], + ), + SizedBox(height: 10), + ZoomTapAnimation( + onTap: () { + if (widget.post.selfie != null) { + switchChoice(); + } + }, + enableLongTapRepeatEvent: false, + longTapRepeatDuration: const Duration(milliseconds: 100), + begin: 1.0, + end: 0.99, + beginDuration: const Duration(milliseconds: 70), + endDuration: const Duration(milliseconds: 100), + beginCurve: Curves.decelerate, + endCurve: Curves.easeInOutSine, + child: AspectRatio( + aspectRatio: 1 / 1, + child: Container( + decoration: BoxDecoration( + // add border + border: const GradientBoxBorder( + gradient: LinearGradient(colors: [ + Colors.transparent, + Color(0xFF323232), + ], begin: Alignment.topCenter, end: Alignment.bottomCenter), + width: 2.5, + ), + // set border radius + borderRadius: BorderRadius.circular(20), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + // implement image + child: Stack( + alignment: Alignment.bottomCenter, + children: [ + Image( + image: NetworkImage(choice ? widget.post.selfie! : widget.post.music.cover!), + fit: BoxFit.cover, + width: double.infinity, + ), + widget.post.selfie != null + ? Positioned( + top: 0, + right: 0, + child: Padding( + padding: EdgeInsets.all(12), + child: Container( + constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), + width: 90.sp, + height: 90.sp, + decoration: BoxDecoration( + color: Colors.white, + // add border + border: Border.all(width: 3, color: Colors.white), + // set border radius + borderRadius: BorderRadius.circular(15), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(13), + // implement image + child: Image( + image: NetworkImage( + choice ? widget.post.music.cover! : widget.post.selfie!), + fit: BoxFit.cover, + ), + ), + ), + )) + : Container(), + ], + ), + ), + ), + )), + SizedBox(height: 15), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Flexible( + flex: 8, + child: TextScroll( + widget.post.music.artists.first.name!, + style: GoogleFonts.plusJakartaSans( + height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), + mode: TextScrollMode.endless, + pauseBetween: Duration(milliseconds: 500), + velocity: Velocity(pixelsPerSecond: Offset(20, 0)), + )), + Padding( + padding: EdgeInsets.only(bottom: 10.h, right: 5.w, left: 5.w), + child: ClipOval( + child: Container( + width: 5.h, + height: 5.h, + color: Colors.white, + ), + ), + ), + Expanded( + flex: 8, + child: Padding( + padding: EdgeInsets.only(bottom: 2), + child: TextScroll( + widget.post.music.title!, + style: GoogleFonts.plusJakartaSans( + height: 1, color: Colors.white, fontWeight: FontWeight.w300, fontSize: 16.h), + mode: TextScrollMode.endless, + velocity: Velocity(pixelsPerSecond: Offset(50, 20)), + pauseBetween: Duration(milliseconds: 500), + ), + )), + Container(width: 10), + AutoSizeText( + widget.post.music.date.toString(), + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, fontSize: 16.h), + textAlign: TextAlign.end, + maxFontSize: 20, + ), + ], + ), + ], + )); + } + + return SizedBox( + width: double.infinity, + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image( + image: NetworkImage(widget.post.user.pp), + width: 40, + ), + ), + ), + Expanded( + flex: 8, + child: Padding( + padding: const EdgeInsets.only(left: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.post.user.pseudo, + style: GoogleFonts.plusJakartaSans(color: Colors.white, fontWeight: FontWeight.w600), + ), + widget.post.location.item2 != null + ? Text( + "${widget.post.location.item1}, ${widget.post.location.item2}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + : Text( + "", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), + fontWeight: FontWeight.w300, + fontSize: 13), + ) + ], + ), + ), + ), + DateTime(today.year, today.month, today.day).isAtSameMomentAs( + DateTime(widget.post.date.year, widget.post.date.month, widget.post.date.day)) + ? Text( + "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ) + : Text( + "hier, ${widget.post.date.hour}:${widget.post.date.minute}", + style: GoogleFonts.plusJakartaSans( + color: Colors.white.withOpacity(0.4), fontWeight: FontWeight.w300, fontSize: 13), + ), + ], + ), + SizedBox(height: 10), + ZoomTapAnimation( + onTap: () { + widget.callback!(widget.index); + }, + enableLongTapRepeatEvent: false, + longTapRepeatDuration: const Duration(milliseconds: 100), + begin: 1.0, + end: 0.99, + beginDuration: const Duration(milliseconds: 70), + endDuration: const Duration(milliseconds: 100), + beginCurve: Curves.decelerate, + endCurve: Curves.easeInOutSine, + child: AspectRatio( + aspectRatio: 1 / 1, + child: Container( + decoration: BoxDecoration( + // add border + border: const GradientBoxBorder( + gradient: LinearGradient(colors: [ + Colors.transparent, + Color(0xFF323232), + ], begin: Alignment.topCenter, end: Alignment.bottomCenter), + width: 2.5, + ), + // set border radius + borderRadius: BorderRadius.circular(20), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(18), + // implement image + child: Stack( + alignment: Alignment.bottomCenter, + children: [ + Image( + image: NetworkImage(widget.post.music.cover!), + fit: BoxFit.cover, + width: double.infinity, + ), + Image( + image: AssetImage("assets/images/shadow_post.png"), + opacity: AnimationController(vsync: this, value: 0.7), + fit: BoxFit.fitHeight, + width: double.infinity, + ), + widget.post.description == null + ? Container() + : Padding( + padding: EdgeInsets.all(15), + child: AutoSizeText( + '“${widget.post.description}”', + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontWeight: FontWeight.w400, fontSize: 15.sp), + maxFontSize: 20, + maxLines: 1, + ), + ), + widget.post.selfie != null + ? Positioned( + top: 0, + right: 0, + child: Padding( + padding: EdgeInsets.all(12), + child: Container( + constraints: BoxConstraints(maxWidth: 140, maxHeight: 140), + width: 90.sp, + height: 90.sp, + decoration: BoxDecoration( + color: Colors.white, + // add border + border: Border.all(width: 3, color: Colors.white), + // set border radius + borderRadius: BorderRadius.circular(15), + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(13), + // implement image + child: Image( + image: NetworkImage(widget.post.selfie!), + fit: BoxFit.cover, + ), + ), + ), + )) + : Container(), + ], + ), + ), + ), + )), + SizedBox(height: 15), + SizedBox( + height: 60, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 8, + child: Padding( + padding: EdgeInsets.only(bottom: 2), + child: TextScroll( + widget.post.music.title!, + style: GoogleFonts.plusJakartaSans( + height: 1, color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), + mode: TextScrollMode.endless, + velocity: Velocity(pixelsPerSecond: Offset(50, 20)), + pauseBetween: Duration(milliseconds: 500), + ), + )), + Container(width: 10), + AutoSizeText( + widget.post.music.date.toString(), + style: GoogleFonts.plusJakartaSans( + color: Colors.white, fontWeight: FontWeight.w600, fontSize: 26.h), + textAlign: TextAlign.end, + maxFontSize: 20, + ), + ], + ), + Expanded( + flex: 8, + child: TextScroll( + widget.post.music.artists.first.name!, + style: GoogleFonts.plusJakartaSans( + height: 1, + color: Colors.white.withOpacity(0.5), + fontWeight: FontWeight.w300, + fontSize: 16.h), + mode: TextScrollMode.endless, + pauseBetween: Duration(milliseconds: 500), + velocity: Velocity(pixelsPerSecond: Offset(20, 0)), + )), + ], + ), + ) + ], + )); + }, + ), + ); + } +} diff --git a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart index e13bc85..950d0ee 100644 --- a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart +++ b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart @@ -15,18 +15,22 @@ import '../values/constants.dart'; class TopNavBarComponent extends StatefulWidget { final Function(bool) callback; - const TopNavBarComponent({Key? key, required this.callback}) : super(key: key); + + const TopNavBarComponent({Key? key, required this.callback}) + : super(key: key); @override State createState() => _TopNavBarComponentState(); } -class _TopNavBarComponentState extends State with TickerProviderStateMixin { +class _TopNavBarComponentState extends State + with TickerProviderStateMixin { bool choice = true; bool isDismissed = true; - final DateTime midnight = DateTime(DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); + final DateTime midnight = DateTime( + DateTime.now().year, DateTime.now().month, DateTime.now().day + 1); void actionSurBouton(bool choice) async { widget.callback(choice); @@ -45,7 +49,8 @@ class _TopNavBarComponentState extends State with TickerProv var now = tz.TZDateTime.now(franceTimeZone); // Calculate the midnight time for the next day in France timezone - var midnight = tz.TZDateTime(franceTimeZone, now.year, now.month, now.day + 1); + var midnight = + tz.TZDateTime(franceTimeZone, now.year, now.month, now.day + 1); bool res = await MyApp.postViewModel.getAvailable(); if (res) { @@ -64,7 +69,8 @@ class _TopNavBarComponentState extends State with TickerProv alignment: Alignment.centerLeft, child: Text( "Capsule disponible", - style: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), + style: + GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), ), ), flushbarStyle: FlushbarStyle.FLOATING, @@ -101,7 +107,8 @@ class _TopNavBarComponentState extends State with TickerProv alignment: Alignment.centerLeft, child: CountdownTimer( endTime: midnight.millisecondsSinceEpoch, - textStyle: GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), + textStyle: + GoogleFonts.plusJakartaSans(color: Colors.grey, fontSize: 15), ), ), flushbarStyle: FlushbarStyle.FLOATING, @@ -193,23 +200,30 @@ class _TopNavBarComponentState extends State with TickerProv } }, child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { + builder: (BuildContext context, + BoxConstraints constraints) { if (choice) { return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + padding: const EdgeInsets.only( + left: 8, top: 0, right: 8, bottom: 6), child: AutoSizeText( "Mes amis", style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w500, fontSize: 16, color: Colors.white), + fontWeight: FontWeight.w500, + fontSize: 16, + color: Colors.white), ), ); } else { return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + padding: const EdgeInsets.only( + left: 8, top: 0, right: 8, bottom: 6), child: AutoSizeText( "Mes amis", style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w300, fontSize: 16, color: unactiveFeed), + fontWeight: FontWeight.w300, + fontSize: 16, + color: unactiveFeed), )); } }, @@ -226,22 +240,29 @@ class _TopNavBarComponentState extends State with TickerProv } }, child: LayoutBuilder( - builder: (BuildContext context, BoxConstraints constraints) { + builder: (BuildContext context, + BoxConstraints constraints) { if (choice) { return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + padding: const EdgeInsets.only( + left: 8, top: 0, right: 8, bottom: 6), child: AutoSizeText( "Discovery", style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w300, fontSize: 16, color: unactiveFeed), + fontWeight: FontWeight.w300, + fontSize: 16, + color: unactiveFeed), )); } else { return Padding( - padding: const EdgeInsets.only(left: 8, top: 0, right: 8, bottom: 6), + padding: const EdgeInsets.only( + left: 8, top: 0, right: 8, bottom: 6), child: AutoSizeText( "Discovery", style: GoogleFonts.plusJakartaSans( - fontWeight: FontWeight.w500, fontSize: 16, color: Colors.white), + fontWeight: FontWeight.w500, + fontSize: 16, + color: Colors.white), )); } }, diff --git a/Sources/justMUSIC/lib/main.dart b/Sources/justMUSIC/lib/main.dart index 3c6a7ce..83fabcd 100644 --- a/Sources/justMUSIC/lib/main.dart +++ b/Sources/justMUSIC/lib/main.dart @@ -3,6 +3,7 @@ import 'package:audioplayers/audioplayers.dart'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; import 'package:firebase_core/firebase_core.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -31,6 +32,7 @@ Future main() async { await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); + await FirebaseMessaging.instance.requestPermission(sound: true); runApp(const MyApp()); } @@ -65,7 +67,8 @@ class _MyAppState extends State { print('User is currently signed out!'); return null; } else { - MyApp.userViewModel.userCurrent = (await (MyApp.userViewModel.getUser(user.uid)))!; + MyApp.userViewModel.userCurrent = + (await (MyApp.userViewModel.getUser(user.uid)))!; userCurrent = Stream.value(MyApp.userViewModel.userCurrent); print('User is signed in!'); } @@ -112,14 +115,16 @@ class _MyAppState extends State { return FutureBuilder( future: MyApp.userViewModel.getUser(snapshot.data!.uid), builder: (context, userSnapshot) { - if (userSnapshot.connectionState == ConnectionState.waiting) { + if (userSnapshot.connectionState == + ConnectionState.waiting) { return LoadingScreen(); } else if (userSnapshot.hasData) { MyApp.userViewModel.userCurrent = userSnapshot.data!; return AnimatedSwitcher( duration: Duration(milliseconds: 1000), transitionBuilder: (child, animation) { - return FadeTransition(opacity: animation, child: child); + return FadeTransition( + opacity: animation, child: child); }, child: FeedScreen(), ); diff --git a/Sources/justMUSIC/lib/model/User.dart b/Sources/justMUSIC/lib/model/User.dart index 2507da7..d88a05e 100644 --- a/Sources/justMUSIC/lib/model/User.dart +++ b/Sources/justMUSIC/lib/model/User.dart @@ -4,13 +4,14 @@ class User { String _uniquePseudo; String _mail; String _pp; + String _token; List _followers; int _capsules; List _followed; // Constructor - User(this._id, this._pseudo, this._uniquePseudo, this._mail, - this._pp, this._followers, this._capsules, this._followed); + User(this._id, this._pseudo, this._uniquePseudo, this._mail, this._pp, + this._token, this._followers, this._capsules, this._followed); //Getters and setters String get id => _id; @@ -39,6 +40,12 @@ class User { _pp = value; } + String get token => _token; + + set token(String value) { + _token = value; + } + int get capsules => _capsules; set capsules(int value) { diff --git a/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart b/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart index 3977830..ae4b96b 100644 --- a/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart +++ b/Sources/justMUSIC/lib/model/mapper/CommentMapper.dart @@ -1,13 +1,14 @@ -import 'package:cloud_firestore/cloud_firestore.dart'; - -import '../../main.dart'; -import '../Comment.dart'; -import '../User.dart'; - -class CommentMapper { - static Future toModel(DocumentSnapshot> snapshot) async { - final data = snapshot.data(); - User? user = await MyApp.userViewModel.getUser(data?['user_id']); - return Comment(snapshot.id, user!, data?["text"] ?? "", data?["date"].toDate()); - } -} +import 'package:cloud_firestore/cloud_firestore.dart'; + +import '../../main.dart'; +import '../Comment.dart'; +import '../User.dart'; + +class CommentMapper { + static Future toModel( + DocumentSnapshot> snapshot) async { + final data = snapshot.data(); + User? user = await MyApp.userViewModel.getUser(data?['user_id']); + return Comment(snapshot.id, user!, data?["text"], data?["date"].toDate()); + } +} diff --git a/Sources/justMUSIC/lib/model/mapper/UserMapper.dart b/Sources/justMUSIC/lib/model/mapper/UserMapper.dart index 7d4c6c1..7d0c5ab 100644 --- a/Sources/justMUSIC/lib/model/mapper/UserMapper.dart +++ b/Sources/justMUSIC/lib/model/mapper/UserMapper.dart @@ -10,6 +10,7 @@ class UserMapper { data?["unique_id"], data?["mail"], data?["picture"], + data?["token_notify"], List.from(data?["followers"] as List), data?["nbCapsules"] ?? 0, List.from(data?["followed"] as List)); diff --git a/Sources/justMUSIC/lib/screens/detail_post_screen.dart b/Sources/justMUSIC/lib/screens/detail_post_screen.dart index 68c96c3..140e42d 100644 --- a/Sources/justMUSIC/lib/screens/detail_post_screen.dart +++ b/Sources/justMUSIC/lib/screens/detail_post_screen.dart @@ -21,6 +21,7 @@ import '../values/constants.dart'; class DetailPostScreen extends StatefulWidget { final Post post; + const DetailPostScreen({super.key, required this.post}); @override @@ -31,6 +32,7 @@ class _DetailPostScreenState extends State { TextEditingController _textController = TextEditingController(); late FocusNode myFocusNode; late StreamSubscription keyboardSubscription; + Future resetFullScreen() async { await SystemChannels.platform.invokeMethod( 'SystemChrome.restoreSystemUIOverlays', @@ -59,11 +61,13 @@ class _DetailPostScreenState extends State { print("ajrd: ${DateTime.now().toString()}"); myFocusNode = FocusNode(); var keyboardVisibilityController = KeyboardVisibilityController(); - print('Keyboard visibility direct query: ${keyboardVisibilityController.isVisible}'); + print( + 'Keyboard visibility direct query: ${keyboardVisibilityController.isVisible}'); super.initState(); - keyboardSubscription = keyboardVisibilityController.onChange.listen((bool visible) { + keyboardSubscription = + keyboardVisibilityController.onChange.listen((bool visible) { if (!visible) { myFocusNode.unfocus(); } @@ -103,8 +107,11 @@ class _DetailPostScreenState extends State { height: 400, width: double.infinity, child: FadeInImage.assetNetwork( - placeholder: "assets/images/loadingPlaceholder.gif", - image: choice ? widget.post.selfie! : widget.post.music.cover!, + placeholder: + "assets/images/loadingPlaceholder.gif", + image: choice + ? widget.post.selfie! + : widget.post.music.cover!, width: double.infinity, fit: BoxFit.cover, ), @@ -125,89 +132,134 @@ class _DetailPostScreenState extends State { ), ), child: Padding( - padding: const EdgeInsets.fromLTRB(20, 0, 20, 10), + padding: + const EdgeInsets.fromLTRB(20, 0, 20, 10), child: Row( crossAxisAlignment: CrossAxisAlignment.end, children: [ Padding( - padding: const EdgeInsets.only(right: 10), + padding: + const EdgeInsets.only(right: 10), child: choice ? Padding( - padding: const EdgeInsets.all(4), + padding: + const EdgeInsets.all(4), child: ClipOval( child: SizedBox.fromSize( // Image radius child: Image( - image: NetworkImage(widget.post.user.pp), + image: NetworkImage( + widget.post.user.pp), width: 45, ), ), ), ) - : widget.post.music.previewUrl != null - ? ButtonPlayComponent(music: widget.post.music) + : widget.post.music.previewUrl != + null + ? ButtonPlayComponent( + music: widget.post.music) : Container(), ), Flexible( child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Flexible( child: Row( - crossAxisAlignment: CrossAxisAlignment.end, + crossAxisAlignment: + CrossAxisAlignment.end, children: [ Expanded( child: ScrollConfiguration( - behavior: ScrollBehavior().copyWith(scrollbars: false), + behavior: ScrollBehavior() + .copyWith( + scrollbars: + false), child: TextScroll( - choice ? widget.post.user.pseudo : widget.post.music.title!, - style: GoogleFonts.plusJakartaSans( + choice + ? widget.post.user + .pseudo + : widget.post.music + .title!, + style: GoogleFonts + .plusJakartaSans( height: 1, color: Colors.white, - fontWeight: FontWeight.w800, + fontWeight: + FontWeight.w800, fontSize: 22, ), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0)), + mode: TextScrollMode + .endless, + pauseBetween: Duration( + milliseconds: 500), + velocity: Velocity( + pixelsPerSecond: + Offset(20, 0)), ), ), ), Padding( - padding: const EdgeInsets.only(left: 20.0), + padding: + const EdgeInsets.only( + left: 20.0), child: choice - ? DateTime(today.year, today.month, today.day).isAtSameMomentAs( + ? DateTime( + today.year, + today.month, + today.day) + .isAtSameMomentAs( DateTime( - widget.post.date.year, - widget.post.date.month, - widget.post.date.day, + widget.post.date + .year, + widget.post.date + .month, + widget.post.date + .day, ), ) ? Text( "Aujourd'hui, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( + style: GoogleFonts + .plusJakartaSans( height: 1, - color: Colors.white, - fontWeight: FontWeight.w900, + color: Colors + .white, + fontWeight: + FontWeight + .w900, fontSize: 18, ), ) : Text( "hier, ${widget.post.date.hour}:${widget.post.date.minute}", - style: GoogleFonts.plusJakartaSans( + style: GoogleFonts + .plusJakartaSans( height: 1, - color: Colors.white, - fontWeight: FontWeight.w900, + color: Colors + .white, + fontWeight: + FontWeight + .w900, fontSize: 18, ), ) : Text( - widget.post.music.date.toString(), - style: GoogleFonts.plusJakartaSans( + widget + .post.music.date + .toString(), + style: GoogleFonts + .plusJakartaSans( height: 1, - color: Colors.white, - fontWeight: FontWeight.w900, + color: + Colors.white, + fontWeight: + FontWeight + .w900, fontSize: 18, ), ), @@ -216,36 +268,52 @@ class _DetailPostScreenState extends State { ), ), choice - ? widget.post.location.item2 != null + ? widget.post.location.item2 != + null ? Text( "${widget.post.location.item1}, ${widget.post.location.item2}", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.5), - fontWeight: FontWeight.w400, + style: GoogleFonts + .plusJakartaSans( + color: Colors.white + .withOpacity(0.5), + fontWeight: + FontWeight.w400, fontSize: 15, ), ) : Text( "", - style: GoogleFonts.plusJakartaSans( - color: Colors.white.withOpacity(0.4), - fontWeight: FontWeight.w300, + style: GoogleFonts + .plusJakartaSans( + color: Colors.white + .withOpacity(0.4), + fontWeight: + FontWeight.w300, fontSize: 13, ), ) : ScrollConfiguration( - behavior: ScrollBehavior().copyWith(scrollbars: false), + behavior: ScrollBehavior() + .copyWith( + scrollbars: false), child: TextScroll( - widget.post.music.artists.first.name!, - style: GoogleFonts.plusJakartaSans( + widget.post.music.artists + .first.name!, + style: GoogleFonts + .plusJakartaSans( height: 1, color: Colors.white, - fontWeight: FontWeight.w500, + fontWeight: + FontWeight.w500, fontSize: 17, ), - mode: TextScrollMode.endless, - pauseBetween: Duration(milliseconds: 500), - velocity: Velocity(pixelsPerSecond: Offset(20, 0)), + mode: TextScrollMode + .endless, + pauseBetween: Duration( + milliseconds: 500), + velocity: Velocity( + pixelsPerSecond: + Offset(20, 0)), ), ), ], @@ -259,7 +327,8 @@ class _DetailPostScreenState extends State { ? Align( alignment: Alignment.bottomLeft, child: Padding( - padding: const EdgeInsets.fromLTRB(50, 35, 50, 35), + padding: const EdgeInsets.fromLTRB( + 50, 35, 50, 35), child: Text( widget.post.description!, textAlign: TextAlign.left, @@ -289,50 +358,77 @@ class _DetailPostScreenState extends State { child: Column( children: [ Padding( - padding: EdgeInsets.symmetric(vertical: 20), + padding: + EdgeInsets.symmetric(vertical: 20), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, children: [ - SvgPicture.asset("assets/images/heart.svg", semanticsLabel: 'Like Logo'), + SvgPicture.asset( + "assets/images/heart.svg", + semanticsLabel: 'Like Logo'), GestureDetector( onTap: () { myFocusNode.requestFocus(); }, - child: - SvgPicture.asset("assets/images/chat.svg", semanticsLabel: 'Chat Logo'), + child: SvgPicture.asset( + "assets/images/chat.svg", + semanticsLabel: 'Chat Logo'), ), - SvgPicture.asset("assets/images/add.svg", - semanticsLabel: 'Add playlist Logo'), - SvgPicture.asset("assets/images/save.svg", semanticsLabel: 'Save Logo'), - SvgPicture.asset("assets/images/report.svg", semanticsLabel: 'Report Logo'), + SvgPicture.asset( + "assets/images/add.svg", + semanticsLabel: + 'Add playlist Logo'), + SvgPicture.asset( + "assets/images/save.svg", + semanticsLabel: 'Save Logo'), + SvgPicture.asset( + "assets/images/report.svg", + semanticsLabel: 'Report Logo'), ], ), ), FutureBuilder>( - future: MyApp.commentViewModel.getCommentsByPostId(widget.post.id), - builder: (BuildContext context, AsyncSnapshot> snapshot) { + future: MyApp.commentViewModel + .getCommentsByPostId(widget.post.id), + builder: (BuildContext context, + AsyncSnapshot> + snapshot) { if (snapshot.hasData) { print("test:"); return Column( children: [ snapshot.data!.length > 0 ? Padding( - padding: const EdgeInsets.all(15.0), + padding: + const EdgeInsets.all( + 15.0), child: RichText( text: TextSpan( - text: snapshot.data!.length.toString(), - style: GoogleFonts.plusJakartaSans( + text: snapshot + .data!.length + .toString(), + style: GoogleFonts + .plusJakartaSans( color: Colors.white, - fontWeight: FontWeight.w800, + fontWeight: + FontWeight.w800, ), children: [ TextSpan( - text: snapshot.data!.length > 1 + text: snapshot + .data! + .length > + 1 ? " commentaires" : " commentaire", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, - fontWeight: FontWeight.w400, + style: GoogleFonts + .plusJakartaSans( + color: Colors + .white, + fontWeight: + FontWeight + .w400, ), ), ], @@ -342,13 +438,23 @@ class _DetailPostScreenState extends State { : Container(), snapshot.data!.length > 0 ? Padding( - padding: const EdgeInsets.fromLTRB(20, 0, 20, 20), + padding: const EdgeInsets + .fromLTRB( + 20, 0, 20, 20), child: ListView.builder( shrinkWrap: true, - physics: NeverScrollableScrollPhysics(), - itemCount: snapshot.data?.length, - itemBuilder: (BuildContext context, int index) { - return CommentComponent(comment: snapshot.data![index]); + physics: + NeverScrollableScrollPhysics(), + itemCount: snapshot + .data?.length, + itemBuilder: + (BuildContext + context, + int index) { + return CommentComponent( + comment: snapshot + .data![ + index]); }, ), ) @@ -358,7 +464,8 @@ class _DetailPostScreenState extends State { } else { return Container( child: Center( - child: CupertinoActivityIndicator(), + child: + CupertinoActivityIndicator(), ), ); } @@ -379,11 +486,14 @@ class _DetailPostScreenState extends State { } }, enableLongTapRepeatEvent: false, - longTapRepeatDuration: const Duration(milliseconds: 100), + longTapRepeatDuration: + const Duration(milliseconds: 100), begin: 1.0, end: 0.96, - beginDuration: const Duration(milliseconds: 70), - endDuration: const Duration(milliseconds: 100), + beginDuration: + const Duration(milliseconds: 70), + endDuration: + const Duration(milliseconds: 100), beginCurve: Curves.decelerate, endCurve: Curves.easeInOutSine, child: Container( @@ -392,13 +502,16 @@ class _DetailPostScreenState extends State { height: 120, decoration: BoxDecoration( borderRadius: BorderRadius.circular(20), - border: Border.all(width: 4, color: Colors.white), + border: Border.all( + width: 4, color: Colors.white), ), child: ClipRRect( borderRadius: BorderRadius.circular(15), // implementer l'image child: Image( - image: NetworkImage(choice ? widget.post.music.cover! : widget.post.selfie!), + image: NetworkImage(choice + ? widget.post.music.cover! + : widget.post.selfie!), fit: BoxFit.cover, ), ), @@ -434,7 +547,8 @@ class _DetailPostScreenState extends State { ), ), Padding( - padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom), + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).viewInsets.bottom), child: Container( height: 70, width: double.infinity, @@ -464,7 +578,8 @@ class _DetailPostScreenState extends State { focusNode: myFocusNode, onSubmitted: (value) async { if (value.isNotEmpty) { - await MyApp.commentViewModel.addComment(value, widget.post.id); + await MyApp.commentViewModel + .addComment(value, widget.post.id); } setState(() { _textController.clear(); @@ -472,7 +587,8 @@ class _DetailPostScreenState extends State { }, cursorColor: primaryColor, keyboardType: TextInputType.emailAddress, - style: GoogleFonts.plusJakartaSans(color: Colors.white), + style: GoogleFonts.plusJakartaSans( + color: Colors.white), decoration: InputDecoration( suffixIcon: Icon( Icons.send, @@ -480,19 +596,25 @@ class _DetailPostScreenState extends State { size: 20, ), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(width: 1, color: grayText), - borderRadius: BorderRadius.all(Radius.circular(100)), + borderSide: + BorderSide(width: 1, color: grayText), + borderRadius: + BorderRadius.all(Radius.circular(100)), ), - contentPadding: EdgeInsets.only(top: 0, bottom: 0, left: 20, right: 20), + contentPadding: EdgeInsets.only( + top: 0, bottom: 0, left: 20, right: 20), fillColor: bgModal, filled: true, focusColor: Color.fromRGBO(255, 255, 255, 0.30), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(width: 1, color: grayText), - borderRadius: BorderRadius.all(Radius.circular(100)), + borderSide: + BorderSide(width: 1, color: grayText), + borderRadius: + BorderRadius.all(Radius.circular(100)), ), hintText: 'Ajoutez une réponse...', - hintStyle: GoogleFonts.plusJakartaSans(color: grayText), + hintStyle: + GoogleFonts.plusJakartaSans(color: grayText), ), ), ), @@ -511,7 +633,8 @@ class _DetailPostScreenState extends State { class MyBehavior extends ScrollBehavior { @override - Widget buildOverscrollIndicator(BuildContext context, Widget child, ScrollableDetails details) { + Widget buildOverscrollIndicator( + BuildContext context, Widget child, ScrollableDetails details) { return child; } } diff --git a/Sources/justMUSIC/lib/screens/feed_screen.dart b/Sources/justMUSIC/lib/screens/feed_screen.dart index f28f2fe..ff77931 100644 --- a/Sources/justMUSIC/lib/screens/feed_screen.dart +++ b/Sources/justMUSIC/lib/screens/feed_screen.dart @@ -1,242 +1,273 @@ -import 'dart:async'; -import 'package:circular_reveal_animation/circular_reveal_animation.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:google_fonts/google_fonts.dart'; -import 'package:justmusic/main.dart'; -import 'package:justmusic/main.dart'; -import 'package:tuple/tuple.dart'; -import '../components/post_component.dart'; -import '../components/top_nav_bar_component.dart'; -import '../model/Post.dart'; -import '../values/constants.dart'; -import 'detail_post_screen.dart'; - -class FeedScreen extends StatefulWidget { - const FeedScreen({Key? key}) : super(key: key); - - @override - State createState() => _FeedScreenState(); -} - -class _FeedScreenState extends State with SingleTickerProviderStateMixin { - late AnimationController animationController; - late Animation animation; - late List friendFeed; - Timer? timer; - - late List discoveryFeed; - late List displayFeed; - bool isDismissed = true; - bool choiceFeed = false; - - @override - void initState() { - super.initState(); - friendFeed = MyApp.postViewModel.postsFriends; - discoveryFeed = MyApp.postViewModel.bestPosts; - animationController = AnimationController( - vsync: this, - duration: Duration(milliseconds: 400), - ); - animation = CurvedAnimation( - parent: animationController, - curve: Curves.easeInOutSine, - ); - animationController.forward(); - } - - Future _refresh() async { - if (choiceFeed) { - await MyApp.postViewModel.getBestPosts(); - setState(() {}); - } else { - await MyApp.postViewModel.getPostsFriends(); - setState(() {}); - } - } - - void changeFeed(bool choice) { - // Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre - if (choice) { - setState(() { - animationController.reset(); - displayFeed = MyApp.postViewModel.postsFriends.reversed.toList(); - animationController.forward(); - choiceFeed = false; - }); - } else { - setState(() { - animationController.reset(); - displayFeed = MyApp.postViewModel.bestPosts.reversed.toList(); - animationController.forward(); - choiceFeed = true; - }); - } - } - - void openDetailPost(int index) { - showModalBottomSheet( - backgroundColor: bgModal, - elevation: 1, - constraints: const BoxConstraints( - maxWidth: 600, - ), - isScrollControlled: true, - context: context, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20))), - builder: ((BuildContext context) { - return ClipRRect( - borderRadius: BorderRadius.only(topLeft: Radius.circular(20), topRight: Radius.circular(20)), - child: DetailPostScreen(post: displayFeed[index])); - }), - ); - } - - _fetchData() async { - friendFeed = await MyApp.postViewModel.getPostsFriends(); - discoveryFeed = await MyApp.postViewModel.getBestPosts(); - return Tuple2(friendFeed, displayFeed); - } - - @override - Widget build(BuildContext context) { - if (choiceFeed) { - displayFeed = MyApp.postViewModel.postsFriends.reversed.toList(); - } else { - displayFeed = MyApp.postViewModel.bestPosts.reversed.toList(); - } - _fetchData(); - - return Scaffold( - resizeToAvoidBottomInset: true, - backgroundColor: bgColor, - extendBodyBehindAppBar: true, - body: displayFeed.isEmpty - ? Container( - width: double.infinity, - child: Stack( - fit: StackFit.expand, - children: [ - Container( - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage("assets/images/empty_bg.png"), fit: BoxFit.cover, opacity: 0.3), - ), - child: Padding( - padding: EdgeInsets.only(top: 140.h, left: defaultPadding), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text("Suis tes amis pour voir leurs capsules", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, fontSize: 23, fontWeight: FontWeight.w800)) - ], - ), - ), - ), - Align( - alignment: Alignment.topCenter, - child: IgnorePointer( - child: Container( - height: 240.h, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topRight, - stops: [0.3, 1], - colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])), - ), - ), - ), - Align( - alignment: Alignment.topCenter, - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: 800), - child: TopNavBarComponent(callback: changeFeed), - ), - ), - ], - ), - ) - : Container( - width: double.infinity, - height: double.infinity, - child: Stack( - fit: StackFit.expand, - children: [ - Expanded( - child: Align( - alignment: Alignment.topCenter, - child: CircularRevealAnimation( - animation: animation, - centerOffset: Offset(30.w, -100), - child: Expanded( - child: Container( - height: double.infinity, - constraints: BoxConstraints(maxWidth: 600), - padding: EdgeInsets.fromLTRB(defaultPadding, 100.h, defaultPadding, 0), - child: Expanded( - child: FutureBuilder( - future: _fetchData(), - builder: (BuildContext context, AsyncSnapshot snapshot) { - if (snapshot.hasData) { - return RefreshIndicator( - displacement: 20, - triggerMode: RefreshIndicatorTriggerMode.onEdge, - onRefresh: _refresh, - child: Expanded( - child: ListView.builder( - physics: const AlwaysScrollableScrollPhysics(), - clipBehavior: Clip.none, - shrinkWrap: true, - itemCount: displayFeed.length, - itemBuilder: (BuildContext context, int index) { - return Padding( - padding: const EdgeInsets.only(bottom: 40), - child: PostComponent( - callback: openDetailPost, post: displayFeed[index], index: index), - ); - }, - ), - ), - ); - } else { - return Center( - child: CupertinoActivityIndicator(), - ); - } - }, - ), - )), - ), - ), - ), - ), - Align( - alignment: Alignment.topCenter, - child: IgnorePointer( - child: Container( - height: 240.h, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topRight, - stops: [0.3, 1], - colors: [bgColor.withOpacity(0.9), bgColor.withOpacity(0)])), - ), - ), - ), - Align( - alignment: Alignment.topCenter, - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: 800), - child: TopNavBarComponent(callback: changeFeed), - ), - ), - ], - ), - )); - } -} +import 'dart:async'; +import 'package:circular_reveal_animation/circular_reveal_animation.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:google_fonts/google_fonts.dart'; +import 'package:justmusic/main.dart'; +import 'package:justmusic/main.dart'; +import 'package:tuple/tuple.dart'; +import '../components/post_component.dart'; +import '../components/top_nav_bar_component.dart'; +import '../model/Post.dart'; +import '../values/constants.dart'; +import 'detail_post_screen.dart'; + +class FeedScreen extends StatefulWidget { + const FeedScreen({Key? key}) : super(key: key); + + @override + State createState() => _FeedScreenState(); +} + +class _FeedScreenState extends State + with SingleTickerProviderStateMixin { + late AnimationController animationController; + late Animation animation; + late List friendFeed; + Timer? timer; + + late List discoveryFeed; + late List displayFeed; + bool isDismissed = true; + bool choiceFeed = false; + + @override + void initState() { + super.initState(); + friendFeed = MyApp.postViewModel.postsFriends; + discoveryFeed = MyApp.postViewModel.bestPosts; + animationController = AnimationController( + vsync: this, + duration: Duration(milliseconds: 400), + ); + animation = CurvedAnimation( + parent: animationController, + curve: Curves.easeInOutSine, + ); + animationController.forward(); + } + + Future _refresh() async { + if (choiceFeed) { + await MyApp.postViewModel.getBestPosts(); + setState(() {}); + } else { + await MyApp.postViewModel.getPostsFriends(); + setState(() {}); + } + } + + void changeFeed(bool choice) { + // Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre + if (choice) { + setState(() { + animationController.reset(); + displayFeed = MyApp.postViewModel.postsFriends.reversed.toList(); + animationController.forward(); + choiceFeed = false; + }); + } else { + setState(() { + animationController.reset(); + displayFeed = MyApp.postViewModel.bestPosts.reversed.toList(); + animationController.forward(); + choiceFeed = true; + }); + } + } + + void openDetailPost(int index) { + showModalBottomSheet( + backgroundColor: bgModal, + elevation: 1, + constraints: const BoxConstraints( + maxWidth: 600, + ), + isScrollControlled: true, + context: context, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), topRight: Radius.circular(20))), + builder: ((BuildContext context) { + return ClipRRect( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), topRight: Radius.circular(20)), + child: DetailPostScreen(post: displayFeed[index])); + }), + ); + } + + _fetchData() async { + friendFeed = await MyApp.postViewModel.getPostsFriends(); + discoveryFeed = await MyApp.postViewModel.getBestPosts(); + return Tuple2(friendFeed, displayFeed); + } + + @override + Widget build(BuildContext context) { + if (choiceFeed) { + displayFeed = MyApp.postViewModel.postsFriends.reversed.toList(); + } else { + displayFeed = MyApp.postViewModel.bestPosts.reversed.toList(); + } + _fetchData(); + + return Scaffold( + resizeToAvoidBottomInset: true, + backgroundColor: bgColor, + extendBodyBehindAppBar: true, + body: displayFeed.isEmpty + ? Container( + width: double.infinity, + child: Stack( + fit: StackFit.expand, + children: [ + Container( + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/empty_bg.png"), + fit: BoxFit.cover, + opacity: 0.3), + ), + child: Padding( + padding: + EdgeInsets.only(top: 140.h, left: defaultPadding), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Suis tes amis pour voir leurs capsules", + style: GoogleFonts.plusJakartaSans( + color: Colors.white, + fontSize: 23, + fontWeight: FontWeight.w800)) + ], + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child: IgnorePointer( + child: Container( + height: 240.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topRight, + stops: [ + 0.3, + 1 + ], + colors: [ + bgColor.withOpacity(0.9), + bgColor.withOpacity(0) + ])), + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: 800), + child: TopNavBarComponent(callback: changeFeed), + ), + ), + ], + ), + ) + : Container( + width: double.infinity, + height: double.infinity, + child: Stack( + fit: StackFit.expand, + children: [ + Expanded( + child: Align( + alignment: Alignment.topCenter, + child: CircularRevealAnimation( + animation: animation, + centerOffset: Offset(30.w, -100), + child: Expanded( + child: Container( + height: double.infinity, + constraints: BoxConstraints(maxWidth: 600), + padding: EdgeInsets.fromLTRB( + defaultPadding, 100.h, defaultPadding, 0), + child: Expanded( + child: FutureBuilder( + future: _fetchData(), + builder: (BuildContext context, + AsyncSnapshot snapshot) { + if (snapshot.hasData) { + return RefreshIndicator( + displacement: 20, + triggerMode: + RefreshIndicatorTriggerMode + .onEdge, + onRefresh: _refresh, + child: Expanded( + child: ListView.builder( + physics: + const AlwaysScrollableScrollPhysics(), + clipBehavior: Clip.none, + shrinkWrap: true, + itemCount: displayFeed.length, + itemBuilder: + (BuildContext context, + int index) { + return Padding( + padding: + const EdgeInsets.only( + bottom: 40), + child: PostComponent( + callback: openDetailPost, + post: displayFeed[index], + index: index), + ); + }, + ), + ), + ); + } else { + return Center( + child: CupertinoActivityIndicator(), + ); + } + }, + ), + )), + ), + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child: IgnorePointer( + child: Container( + height: 240.h, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topRight, + stops: [ + 0.3, + 1 + ], + colors: [ + bgColor.withOpacity(0.9), + bgColor.withOpacity(0) + ])), + ), + ), + ), + Align( + alignment: Alignment.topCenter, + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: 800), + child: TopNavBarComponent(callback: changeFeed), + ), + ), + ], + ), + )); + } +} diff --git a/Sources/justMUSIC/lib/services/AuthService.dart b/Sources/justMUSIC/lib/services/AuthService.dart index 818fddf..39ba6c2 100644 --- a/Sources/justMUSIC/lib/services/AuthService.dart +++ b/Sources/justMUSIC/lib/services/AuthService.dart @@ -1,15 +1,24 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:firebase_auth/firebase_auth.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/foundation.dart'; import '../main.dart'; class AuthService { register(String pseudo, String email, String password) async { try { + var token; final data = await FirebaseAuth.instance.createUserWithEmailAndPassword( email: email, password: password, ); + if (kIsWeb) { + token = "empty"; + } else { + token = await FirebaseMessaging.instance.getToken(); + } + String uniqueId = await generateUniqueId(pseudo); final user = { @@ -19,6 +28,7 @@ class AuthService { "followed": [], "nbCapsules": 0, "followers": [], + "token_notify": token, "picture": "https://firebasestorage.googleapis.com/v0/b/justmusic-435d5.appspot.com/o/justMusicDefaultImage.png?alt=media&token=020d0fcb-b7df-4d4d-b380-e99597293fcc" }; diff --git a/Sources/justMUSIC/lib/services/CommentService.dart b/Sources/justMUSIC/lib/services/CommentService.dart index 961dae7..0808b25 100644 --- a/Sources/justMUSIC/lib/services/CommentService.dart +++ b/Sources/justMUSIC/lib/services/CommentService.dart @@ -1,22 +1,28 @@ -import 'package:cloud_firestore/cloud_firestore.dart'; - -import '../main.dart'; - -class CommentService { - createComment(String text, String idPost) async { - var id = MyApp.userViewModel.userCurrent.id; - final comment = {"user_id": id, "text": text, "date": DateTime.now(), "post_id": idPost}; - - await MyApp.db.collection("comments").add(comment); - } - - Future>>> getCommentsByPostId(String id) async { - var response = await FirebaseFirestore.instance - .collection("comments") - .where("post_id", isEqualTo: id) - .orderBy("date", descending: true) - .get(); - - return response.docs; - } -} +import 'package:cloud_firestore/cloud_firestore.dart'; + +import '../main.dart'; + +class CommentService { + createComment(String text, String idPost) async { + var id = MyApp.userViewModel.userCurrent.id; + final comment = { + "user_id": id, + "text": text, + "date": DateTime.now(), + "post_id": idPost + }; + + await MyApp.db.collection("comments").add(comment); + } + + Future>>> getCommentsByPostId( + String id) async { + var response = await FirebaseFirestore.instance + .collection("comments") + .where("post_id", isEqualTo: id) + .orderBy("date", descending: true) + .get(); + + return response.docs; + } +} diff --git a/Sources/justMUSIC/lib/services/NotificationService.dart b/Sources/justMUSIC/lib/services/NotificationService.dart new file mode 100644 index 0000000..512c03b --- /dev/null +++ b/Sources/justMUSIC/lib/services/NotificationService.dart @@ -0,0 +1,31 @@ +import 'dart:convert'; +import 'package:http/http.dart' as http; + +class NotificationService { + sendPushMessage(String token, String title, String body) async { + try { + await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'), + headers: { + 'Content-Type': 'application/json', + 'Authorization': + 'key=AAAA56TmIPg:APA91bFeKMr_i6CbUuuUdFI1XkdaNE2A7OVHzxrPIsOSlDfhR6qzZwof7JNGxthWUKj1dRHQMheWNYaLbf3AtXUp9o4DX_gB2073yR4urqUEh9CjvnxVws_9g1cWMgmFS3EpaQEA3icC' + }, + body: jsonEncode({ + 'priority': 'high', + 'data': { + 'click_action': 'FLUTTER_NOTIFICATION_CLICK', + 'status': 'done', + 'body': body, + 'title': title + }, + "notification": { + "title": title, + "body": body, + }, + "to": token, + })); + } catch (e) { + print("error push notification"); + } + } +} diff --git a/Sources/justMUSIC/lib/services/PostService.dart b/Sources/justMUSIC/lib/services/PostService.dart index 7e71ff4..4f86827 100644 --- a/Sources/justMUSIC/lib/services/PostService.dart +++ b/Sources/justMUSIC/lib/services/PostService.dart @@ -56,7 +56,7 @@ class PostService { .get(); var filteredPosts = response.docs.where((doc) { - String user = doc["user_id"]; // Assuming the field name is "date" + String user = doc["user_id"]; return user != MyApp.userViewModel.userCurrent.id; }).toList(); return filteredPosts; diff --git a/Sources/justMUSIC/lib/services/UserService.dart b/Sources/justMUSIC/lib/services/UserService.dart index 0a66793..b299f3d 100644 --- a/Sources/justMUSIC/lib/services/UserService.dart +++ b/Sources/justMUSIC/lib/services/UserService.dart @@ -3,11 +3,14 @@ import 'package:cloud_firestore/cloud_firestore.dart'; import '../main.dart'; class UserService { - Future>>> getUsersByIdUnique(String uniqueId) async { - QuerySnapshot> response = await FirebaseFirestore.instance + Future>>> getUsersByIdUnique( + String uniqueId) async { + QuerySnapshot> response = await FirebaseFirestore + .instance .collection("users") .where("unique_id", isGreaterThanOrEqualTo: uniqueId) - .where("unique_id", isLessThanOrEqualTo: uniqueId + "zzzzzzzzzzzzzzzzzzzzzzzzzzzz") + .where("unique_id", + isLessThanOrEqualTo: uniqueId + "zzzzzzzzzzzzzzzzzzzzzzzzzzzz") .limit(20) .get(); var users = response.docs.where((doc) { @@ -18,8 +21,20 @@ class UserService { return users; } + updateTokenNotify(String idUser, String token) { + FirebaseFirestore.instance + .collection('users') + .doc(idUser) + .update({'token_notify': token}).then((_) { + print("Mise à jour réussie !"); + }).catchError((error) { + print("Erreur lors de la mise à jour : $error"); + }); + } + addOrDeleteFriend(String id) async { - var userRef = MyApp.db.collection("users").doc(MyApp.userViewModel.userCurrent.id); + var userRef = + MyApp.db.collection("users").doc(MyApp.userViewModel.userCurrent.id); var actionUserRef = MyApp.db.collection("users").doc(id); if (MyApp.userViewModel.isFriend(id)) { @@ -28,7 +43,7 @@ class UserService { 'followed': FieldValue.arrayRemove([id]) }); transaction.update(actionUserRef, { - 'followers': FieldValue.arrayRemove([id]) + 'followers': FieldValue.arrayRemove([userRef.id]) }); }); MyApp.userViewModel.userCurrent.followed.remove(id); @@ -38,7 +53,7 @@ class UserService { 'followed': FieldValue.arrayUnion([id]) }); transaction.update(actionUserRef, { - 'followers': FieldValue.arrayUnion([id]) + 'followers': FieldValue.arrayUnion([userRef.id]) }); }); MyApp.userViewModel.userCurrent.followed.add(id); diff --git a/Sources/justMUSIC/lib/view_model/CommentViewModel.dart b/Sources/justMUSIC/lib/view_model/CommentViewModel.dart index 9ea71f7..c3aa0a4 100644 --- a/Sources/justMUSIC/lib/view_model/CommentViewModel.dart +++ b/Sources/justMUSIC/lib/view_model/CommentViewModel.dart @@ -23,13 +23,10 @@ class CommentViewModel { Future> getCommentsByPostId(String id) async { try { var responseData = await _commentService.getCommentsByPostId(id); - print(responseData.length); var commentsFutures = responseData.map((value) async { return await CommentMapper.toModel(value); }).toList(); _comments = await Future.wait(commentsFutures); - print("ccccccc"); - _comments.map((e) => print(e.text)); return _comments; } catch (e) { print(e); diff --git a/Sources/justMUSIC/lib/view_model/UserViewModel.dart b/Sources/justMUSIC/lib/view_model/UserViewModel.dart index 1817835..b3cf791 100644 --- a/Sources/justMUSIC/lib/view_model/UserViewModel.dart +++ b/Sources/justMUSIC/lib/view_model/UserViewModel.dart @@ -1,4 +1,6 @@ import 'package:firebase_auth/firebase_auth.dart' as firebase_auth; +import 'package:firebase_messaging/firebase_messaging.dart'; +import 'package:flutter/foundation.dart'; import 'package:justmusic/services/AuthService.dart'; import 'package:justmusic/services/UserService.dart'; @@ -27,8 +29,20 @@ class UserViewModel { login(String pseudo, String password) async { try { + var token; await authService.login(pseudo, password); - final user = await MyApp.db.collection("users").doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid).get(); + final user = await MyApp.db + .collection("users") + .doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid) + .get(); + if (!kIsWeb) { + token = await FirebaseMessaging.instance.getToken(); + if (MyApp.userViewModel.userCurrent.token != token) { + _userService.updateTokenNotify( + MyApp.userViewModel.userCurrent.id, token); + MyApp.userViewModel.userCurrent.token = token; + } + } User data = UserMapper.toModel(user); _userCurrent = data; } catch (e) { @@ -43,7 +57,10 @@ class UserViewModel { updateUserCurrent() async { try { - final user = await MyApp.db.collection("users").doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid).get(); + final user = await MyApp.db + .collection("users") + .doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid) + .get(); User data = UserMapper.toModel(user); _userCurrent = data; } catch (e) { @@ -58,7 +75,10 @@ class UserViewModel { try { await authService.register(pseudo.toLowerCase(), email, password); - final user = await MyApp.db.collection("users").doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid).get(); + final user = await MyApp.db + .collection("users") + .doc(firebase_auth.FirebaseAuth.instance.currentUser?.uid) + .get(); User data = UserMapper.toModel(user); _userCurrent = data; } catch (e) { @@ -68,7 +88,8 @@ class UserViewModel { Future> getUsersByUniqueId(String uniqueId) async { try { - var response = await _userService.getUsersByIdUnique(uniqueId.toLowerCase()); + var response = + await _userService.getUsersByIdUnique(uniqueId.toLowerCase()); var users = response.map((value) { return UserMapper.toModel(value); }).toList(); diff --git a/Sources/justMUSIC/pubspec.lock b/Sources/justMUSIC/pubspec.lock index 27bf207..8268097 100644 --- a/Sources/justMUSIC/pubspec.lock +++ b/Sources/justMUSIC/pubspec.lock @@ -1,1026 +1,1050 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - _flutterfire_internals: - dependency: transitive - description: - name: _flutterfire_internals - sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8" - url: "https://pub.dev" - source: hosted - version: "1.3.4" - animated_appear: - dependency: "direct main" - description: - name: animated_appear - sha256: "53097d7bb6d5e4a1a3a74c8f3028c47c87101c6ec8903f2002372d1eb5aee991" - url: "https://pub.dev" - source: hosted - version: "0.0.4" - animations: - dependency: "direct main" - description: - name: animations - sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 - url: "https://pub.dev" - source: hosted - version: "2.0.7" - another_flushbar: - dependency: "direct main" - description: - name: another_flushbar - sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" - url: "https://pub.dev" - source: hosted - version: "1.12.30" - archive: - dependency: transitive - description: - name: archive - sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" - url: "https://pub.dev" - source: hosted - version: "3.3.7" - args: - dependency: transitive - description: - name: args - sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 - url: "https://pub.dev" - source: hosted - version: "2.4.2" - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - audioplayers: - dependency: "direct main" - description: - name: audioplayers - sha256: "61583554386721772f9309f509e17712865b38565a903c761f96b1115a979282" - url: "https://pub.dev" - source: hosted - version: "4.1.0" - audioplayers_android: - dependency: transitive - description: - name: audioplayers_android - sha256: dbdc9b7f2aa2440314c638aa55aadd45c7705e8340d5eddf2e3fb8da32d4ae2c - url: "https://pub.dev" - source: hosted - version: "3.0.2" - audioplayers_darwin: - dependency: transitive - description: - name: audioplayers_darwin - sha256: "6aea96df1d12f7ad5a71d88c6d1b22a216211a9564219920124c16768e456e9d" - url: "https://pub.dev" - source: hosted - version: "4.1.0" - audioplayers_linux: - dependency: transitive - description: - name: audioplayers_linux - sha256: "396b62ac62c92dd26c3bc5106583747f57a8b325ebd2b41e5576f840cfc61338" - url: "https://pub.dev" - source: hosted - version: "2.1.0" - audioplayers_platform_interface: - dependency: transitive - description: - name: audioplayers_platform_interface - sha256: f7daaed4659143094151ecf6bacd927d29ab8acffba98c110c59f0b81ae51143 - url: "https://pub.dev" - source: hosted - version: "5.0.1" - audioplayers_web: - dependency: transitive - description: - name: audioplayers_web - sha256: ec84fd46eed1577148ed4113f5998a36a18da4fce7170c37ce3e21b631393339 - url: "https://pub.dev" - source: hosted - version: "3.1.0" - audioplayers_windows: - dependency: transitive - description: - name: audioplayers_windows - sha256: "1d3aaac98a192b8488167711ba1e67d8b96333e8d0572ede4e2912e5bbce69a3" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - auto_size_text: - dependency: "direct main" - description: - name: auto_size_text - sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" - url: "https://pub.dev" - source: hosted - version: "3.0.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - circular_reveal_animation: - dependency: "direct main" - description: - name: circular_reveal_animation - sha256: "198f5a1fa27384dcf950807e0ae07a0da857c04df6233f7468755ee9db102b0c" - url: "https://pub.dev" - source: hosted - version: "2.0.1" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - cloud_firestore: - dependency: "direct main" - description: - name: cloud_firestore - sha256: f1a06ad4499ed9ab73703560d44893e6b9e66ce3923c9121f4ef3981c972057f - url: "https://pub.dev" - source: hosted - version: "4.8.4" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - sha256: "86bd1865abbeb09a7d09da3e70364a09f894937270651fc611a1c6d6a9f7b02c" - url: "https://pub.dev" - source: hosted - version: "5.15.3" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - sha256: ac2eeb2a7ab1928c3aacc30eed750fa839d6f620e112a5459e321df217be2f47 - url: "https://pub.dev" - source: hosted - version: "3.6.3" - collection: - dependency: transitive - description: - name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" - url: "https://pub.dev" - source: hosted - version: "1.17.1" - convert: - dependency: transitive - description: - name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" - url: "https://pub.dev" - source: hosted - version: "3.1.1" - cross_file: - dependency: transitive - description: - name: cross_file - sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" - url: "https://pub.dev" - source: hosted - version: "0.3.3+4" - crypto: - dependency: transitive - description: - name: crypto - sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab - url: "https://pub.dev" - source: hosted - version: "3.0.3" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be - url: "https://pub.dev" - source: hosted - version: "1.0.5" - custom_draggable_widget: - dependency: "direct main" - description: - name: custom_draggable_widget - sha256: "15718003ebcebb84acdf0c625831a880d139a284d8de9d943ef0d0a669f10159" - url: "https://pub.dev" - source: hosted - version: "0.0.2" - custom_refresh_indicator: - dependency: "direct main" - description: - name: custom_refresh_indicator - sha256: "65a463f09623f6baf75e45e0c9034e9304810be3f5dfb00a54edde7252f4a524" - url: "https://pub.dev" - source: hosted - version: "2.2.1" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - ffi: - dependency: transitive - description: - name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 - url: "https://pub.dev" - source: hosted - version: "2.0.2" - file: - dependency: transitive - description: - name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" - url: "https://pub.dev" - source: hosted - version: "6.1.4" - file_selector_linux: - dependency: transitive - description: - name: file_selector_linux - sha256: "770eb1ab057b5ae4326d1c24cc57710758b9a46026349d021d6311bd27580046" - url: "https://pub.dev" - source: hosted - version: "0.9.2" - file_selector_macos: - dependency: transitive - description: - name: file_selector_macos - sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412" - url: "https://pub.dev" - source: hosted - version: "0.9.3+1" - file_selector_platform_interface: - dependency: transitive - description: - name: file_selector_platform_interface - sha256: "412705a646a0ae90f33f37acfae6a0f7cbc02222d6cd34e479421c3e74d3853c" - url: "https://pub.dev" - source: hosted - version: "2.6.0" - file_selector_windows: - dependency: transitive - description: - name: file_selector_windows - sha256: "1372760c6b389842b77156203308940558a2817360154084368608413835fc26" - url: "https://pub.dev" - source: hosted - version: "0.9.3" - firebase_auth: - dependency: "direct main" - description: - name: firebase_auth - sha256: "49fd35ce06f2530dd460e5dc123235731cb61dd7c76b0af4b6e190404880d04d" - url: "https://pub.dev" - source: hosted - version: "4.7.2" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - sha256: "817f3ceb84ef5e9adaaf50cf7a19255f6ffcdd12c6f9e9aa4cf00fc7f2eb3cfb" - url: "https://pub.dev" - source: hosted - version: "6.16.1" - firebase_auth_web: - dependency: transitive - description: - name: firebase_auth_web - sha256: e9044778287f1ff8f9f4cee7e247b03ec87bb8977e0e65ad27dc337e196132e8 - url: "https://pub.dev" - source: hosted - version: "5.6.2" - firebase_core: - dependency: "direct main" - description: - name: firebase_core - sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192" - url: "https://pub.dev" - source: hosted - version: "2.15.0" - firebase_core_platform_interface: - dependency: transitive - description: - name: firebase_core_platform_interface - sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 - url: "https://pub.dev" - source: hosted - version: "4.8.0" - firebase_core_web: - dependency: transitive - description: - name: firebase_core_web - sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" - url: "https://pub.dev" - source: hosted - version: "2.6.0" - firebase_storage: - dependency: "direct main" - description: - name: firebase_storage - sha256: "4b747005aee0c611242cdd553f58795f51e1567d2dfd4f75692fac3f67c8c336" - url: "https://pub.dev" - source: hosted - version: "11.2.5" - firebase_storage_platform_interface: - dependency: transitive - description: - name: firebase_storage_platform_interface - sha256: c77c7b6b7d283280993c81ea8ac95552b2ae521a7bb46a95181c1482e62d1633 - url: "https://pub.dev" - source: hosted - version: "4.4.4" - firebase_storage_web: - dependency: transitive - description: - name: firebase_storage_web - sha256: "6906245579f1af225e43df0395c9d9631cb3135cbfa3521a839196d3383bb89a" - url: "https://pub.dev" - source: hosted - version: "3.6.5" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_animated_play_button: - dependency: "direct main" - description: - name: flutter_animated_play_button - sha256: dd955a450a4514e935e2f410afbd03b3bcf5f31b933a8f1334199caa3c6a81e2 - url: "https://pub.dev" - source: hosted - version: "0.3.0" - flutter_countdown_timer: - dependency: "direct main" - description: - name: flutter_countdown_timer - sha256: dfcbd7d6f76a5589f78f3f3ba2f9ea2e199368eccc1adce4153ce985b9587bc5 - url: "https://pub.dev" - source: hosted - version: "4.1.0" - flutter_keyboard_visibility: - dependency: "direct main" - description: - name: flutter_keyboard_visibility - sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" - url: "https://pub.dev" - source: hosted - version: "5.4.1" - flutter_keyboard_visibility_linux: - dependency: transitive - description: - name: flutter_keyboard_visibility_linux - sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - flutter_keyboard_visibility_macos: - dependency: transitive - description: - name: flutter_keyboard_visibility_macos - sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086 - url: "https://pub.dev" - source: hosted - version: "1.0.0" - flutter_keyboard_visibility_platform_interface: - dependency: transitive - description: - name: flutter_keyboard_visibility_platform_interface - sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4 - url: "https://pub.dev" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_web: - dependency: transitive - description: - name: flutter_keyboard_visibility_web - sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1 - url: "https://pub.dev" - source: hosted - version: "2.0.0" - flutter_keyboard_visibility_windows: - dependency: transitive - description: - name: flutter_keyboard_visibility_windows - sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73 - url: "https://pub.dev" - source: hosted - version: "1.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" - url: "https://pub.dev" - source: hosted - version: "2.0.2" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" - url: "https://pub.dev" - source: hosted - version: "2.0.15" - flutter_screenutil: - dependency: "direct main" - description: - name: flutter_screenutil - sha256: "1b61f8c4cbf965104b6ca7160880ff1af6755aad7fec70b58444245132453745" - url: "https://pub.dev" - source: hosted - version: "5.8.4" - flutter_signin_button: - dependency: "direct main" - description: - name: flutter_signin_button - sha256: a063ecc5d5308377e103c9c3a89084abf15fca4440636233af6a13abacd5dcae - url: "https://pub.dev" - source: hosted - version: "2.0.0" - flutter_svg: - dependency: "direct main" - description: - name: flutter_svg - sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" - url: "https://pub.dev" - source: hosted - version: "2.0.7" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - font_awesome_flutter: - dependency: transitive - description: - name: font_awesome_flutter - sha256: "1f93e5799f0e6c882819e8393a05c6ca5226010f289190f2242ec19f3f0fdba5" - url: "https://pub.dev" - source: hosted - version: "9.2.0" - geolocator: - dependency: "direct main" - description: - name: geolocator - sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" - url: "https://pub.dev" - source: hosted - version: "9.0.2" - geolocator_android: - dependency: transitive - description: - name: geolocator_android - sha256: b06c72853c993ae533f482d81a12805d7a441f5231d9668718bc7131d7464082 - url: "https://pub.dev" - source: hosted - version: "4.2.0" - geolocator_apple: - dependency: transitive - description: - name: geolocator_apple - sha256: "36527c555f4c425f7d8fa8c7c07d67b78e3ff7590d40448051959e1860c1cfb4" - url: "https://pub.dev" - source: hosted - version: "2.2.7" - geolocator_platform_interface: - dependency: transitive - description: - name: geolocator_platform_interface - sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386 - url: "https://pub.dev" - source: hosted - version: "4.0.7" - geolocator_web: - dependency: transitive - description: - name: geolocator_web - sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 - url: "https://pub.dev" - source: hosted - version: "2.1.6" - geolocator_windows: - dependency: transitive - description: - name: geolocator_windows - sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d - url: "https://pub.dev" - source: hosted - version: "0.1.1" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" - url: "https://pub.dev" - source: hosted - version: "4.0.4" - gradiantbutton: - dependency: "direct main" - description: - name: gradiantbutton - sha256: c88ac8567242630cd14231e2a6a861da4e40a02a9a0310af360e05634890d172 - url: "https://pub.dev" - source: hosted - version: "0.0.1" - gradient_borders: - dependency: "direct main" - description: - name: gradient_borders - sha256: "69eeaff519d145a4c6c213ada1abae386bcc8981a4970d923e478ce7ba19e309" - url: "https://pub.dev" - source: hosted - version: "1.0.0" - http: - dependency: "direct main" - description: - name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" - url: "https://pub.dev" - source: hosted - version: "0.13.6" - http_parser: - dependency: transitive - description: - name: http_parser - sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" - url: "https://pub.dev" - source: hosted - version: "4.0.2" - image_picker: - dependency: "direct main" - description: - name: image_picker - sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3" - url: "https://pub.dev" - source: hosted - version: "1.0.1" - image_picker_android: - dependency: transitive - description: - name: image_picker_android - sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34" - url: "https://pub.dev" - source: hosted - version: "0.8.7+4" - image_picker_for_web: - dependency: transitive - description: - name: image_picker_for_web - sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" - url: "https://pub.dev" - source: hosted - version: "2.2.0" - image_picker_ios: - dependency: transitive - description: - name: image_picker_ios - sha256: b3e2f21feb28b24dd73a35d7ad6e83f568337c70afab5eabac876e23803f264b - url: "https://pub.dev" - source: hosted - version: "0.8.8" - image_picker_linux: - dependency: transitive - description: - name: image_picker_linux - sha256: "02cbc21fe1706b97942b575966e5fbbeaac535e76deef70d3a242e4afb857831" - url: "https://pub.dev" - source: hosted - version: "0.2.1" - image_picker_macos: - dependency: transitive - description: - name: image_picker_macos - sha256: cee2aa86c56780c13af2c77b5f2f72973464db204569e1ba2dd744459a065af4 - url: "https://pub.dev" - source: hosted - version: "0.2.1" - image_picker_platform_interface: - dependency: transitive - description: - name: image_picker_platform_interface - sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32 - url: "https://pub.dev" - source: hosted - version: "2.9.0" - image_picker_windows: - dependency: transitive - description: - name: image_picker_windows - sha256: c3066601ea42113922232c7b7b3330a2d86f029f685bba99d82c30e799914952 - url: "https://pub.dev" - source: hosted - version: "0.2.1" - insta_image_viewer: - dependency: "direct main" - description: - name: insta_image_viewer - sha256: "9a81432b1ab907ea91c255ec079440afe43f999533422badffaa482dfb7fdfbb" - url: "https://pub.dev" - source: hosted - version: "1.0.2" - intl: - dependency: "direct main" - description: - name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" - url: "https://pub.dev" - source: hosted - version: "0.18.1" - ionicons: - dependency: "direct main" - description: - name: ionicons - sha256: "5496bc65a16115ecf05b15b78f494ee4a8869504357668f0a11d689e970523cf" - url: "https://pub.dev" - source: hosted - version: "0.2.2" - js: - dependency: transitive - description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 - url: "https://pub.dev" - source: hosted - version: "0.6.7" - lints: - dependency: transitive - description: - name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - lottie: - dependency: "direct main" - description: - name: lottie - sha256: "0793a5866062e5cc8a8b24892fa94c3095953ea914a7fdf790f550dd7537fe60" - url: "https://pub.dev" - source: hosted - version: "2.5.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" - url: "https://pub.dev" - source: hosted - version: "0.12.15" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 - url: "https://pub.dev" - source: hosted - version: "0.2.0" - meta: - dependency: transitive - description: - name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" - url: "https://pub.dev" - source: hosted - version: "1.9.1" - mime: - dependency: transitive - description: - name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e - url: "https://pub.dev" - source: hosted - version: "1.0.4" - modal_bottom_sheet: - dependency: "direct main" - description: - name: modal_bottom_sheet - sha256: ef533916a2c3089571c32bd34e410faca77a6849a3f28f748e0794525c5658a0 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - path: - dependency: transitive - description: - name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" - url: "https://pub.dev" - source: hosted - version: "1.8.3" - path_parsing: - dependency: transitive - description: - name: path_parsing - sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf - url: "https://pub.dev" - source: hosted - version: "1.0.1" - path_provider: - dependency: transitive - description: - name: path_provider - sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" - url: "https://pub.dev" - source: hosted - version: "2.0.15" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" - url: "https://pub.dev" - source: hosted - version: "2.0.27" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" - url: "https://pub.dev" - source: hosted - version: "2.2.4" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 - url: "https://pub.dev" - source: hosted - version: "2.1.11" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" - url: "https://pub.dev" - source: hosted - version: "2.0.6" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" - url: "https://pub.dev" - source: hosted - version: "2.1.7" - petitparser: - dependency: transitive - description: - name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 - url: "https://pub.dev" - source: hosted - version: "5.4.0" - pinch_zoom: - dependency: "direct main" - description: - name: pinch_zoom - sha256: ad12872281742726afaf03438d99a4572c584a612630768953beb6dfd6f9389a - url: "https://pub.dev" - source: hosted - version: "1.0.0" - platform: - dependency: transitive - description: - name: platform - sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" - url: "https://pub.dev" - source: hosted - version: "2.1.5" - pointycastle: - dependency: transitive - description: - name: pointycastle - sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" - url: "https://pub.dev" - source: hosted - version: "3.7.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - smooth_corner: - dependency: "direct main" - description: - name: smooth_corner - sha256: "1e920cffd9644d6f51f9a99674652f8c00f2e9074b275f3edde0de1441ba78e9" - url: "https://pub.dev" - source: hosted - version: "1.1.0" - smooth_list_view: - dependency: "direct main" - description: - name: smooth_list_view - sha256: d6eb3bed78881c50d4574b0dd466ed3321972477688c1c021178f3132155112a - url: "https://pub.dev" - source: hosted - version: "1.0.4" - source_span: - dependency: transitive - description: - name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 - url: "https://pub.dev" - source: hosted - version: "1.9.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 - url: "https://pub.dev" - source: hosted - version: "1.11.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - synchronized: - dependency: transitive - description: - name: synchronized - sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb - url: "https://pub.dev" - source: hosted - version: "0.5.1" - text_scroll: - dependency: "direct main" - description: - name: text_scroll - sha256: "7869d86a6fdd725dee56bdd150216a99f0372b82fbfcac319214dbd5f36e1908" - url: "https://pub.dev" - source: hosted - version: "0.2.0" - timezone: - dependency: "direct main" - description: - name: timezone - sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0" - url: "https://pub.dev" - source: hosted - version: "0.9.2" - top_snackbar_flutter: - dependency: "direct main" - description: - name: top_snackbar_flutter - sha256: "22d14664a13db6ac714934c3382bd8d4daa57fb888a672f922df71981c5a5cb2" - url: "https://pub.dev" - source: hosted - version: "3.1.0" - tuple: - dependency: "direct main" - description: - name: tuple - sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 - url: "https://pub.dev" - source: hosted - version: "2.0.2" - typed_data: - dependency: transitive - description: - name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c - url: "https://pub.dev" - source: hosted - version: "1.3.2" - uuid: - dependency: transitive - description: - name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" - url: "https://pub.dev" - source: hosted - version: "3.0.7" - vector_graphics: - dependency: transitive - description: - name: vector_graphics - sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_graphics_codec: - dependency: transitive - description: - name: vector_graphics_codec - sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_graphics_compiler: - dependency: transitive - description: - name: vector_graphics_compiler - sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" - url: "https://pub.dev" - source: hosted - version: "1.1.7" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - win32: - dependency: transitive - description: - name: win32 - sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0 - url: "https://pub.dev" - source: hosted - version: "5.0.6" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff - url: "https://pub.dev" - source: hosted - version: "1.0.1" - xml: - dependency: transitive - description: - name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" - url: "https://pub.dev" - source: hosted - version: "6.3.0" - zoom_tap_animation: - dependency: "direct main" - description: - name: zoom_tap_animation - sha256: d9f7a73cab65aa1546ba6886b5e21d3c8ccccb34e4e5f770301c306d4868bee0 - url: "https://pub.dev" - source: hosted - version: "1.1.0" -sdks: - dart: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _flutterfire_internals: + dependency: transitive + description: + name: _flutterfire_internals + sha256: "5dce45a06d386358334eb1689108db6455d90ceb0d75848d5f4819283d4ee2b8" + url: "https://pub.dev" + source: hosted + version: "1.3.4" + animated_appear: + dependency: "direct main" + description: + name: animated_appear + sha256: "53097d7bb6d5e4a1a3a74c8f3028c47c87101c6ec8903f2002372d1eb5aee991" + url: "https://pub.dev" + source: hosted + version: "0.0.4" + animations: + dependency: "direct main" + description: + name: animations + sha256: fe8a6bdca435f718bb1dc8a11661b2c22504c6da40ef934cee8327ed77934164 + url: "https://pub.dev" + source: hosted + version: "2.0.7" + another_flushbar: + dependency: "direct main" + description: + name: another_flushbar + sha256: "19bf9520230ec40b300aaf9dd2a8fefcb277b25ecd1c4838f530566965befc2a" + url: "https://pub.dev" + source: hosted + version: "1.12.30" + archive: + dependency: transitive + description: + name: archive + sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" + url: "https://pub.dev" + source: hosted + version: "3.3.7" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + audioplayers: + dependency: "direct main" + description: + name: audioplayers + sha256: "61583554386721772f9309f509e17712865b38565a903c761f96b1115a979282" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + audioplayers_android: + dependency: transitive + description: + name: audioplayers_android + sha256: dbdc9b7f2aa2440314c638aa55aadd45c7705e8340d5eddf2e3fb8da32d4ae2c + url: "https://pub.dev" + source: hosted + version: "3.0.2" + audioplayers_darwin: + dependency: transitive + description: + name: audioplayers_darwin + sha256: "6aea96df1d12f7ad5a71d88c6d1b22a216211a9564219920124c16768e456e9d" + url: "https://pub.dev" + source: hosted + version: "4.1.0" + audioplayers_linux: + dependency: transitive + description: + name: audioplayers_linux + sha256: "396b62ac62c92dd26c3bc5106583747f57a8b325ebd2b41e5576f840cfc61338" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + audioplayers_platform_interface: + dependency: transitive + description: + name: audioplayers_platform_interface + sha256: f7daaed4659143094151ecf6bacd927d29ab8acffba98c110c59f0b81ae51143 + url: "https://pub.dev" + source: hosted + version: "5.0.1" + audioplayers_web: + dependency: transitive + description: + name: audioplayers_web + sha256: ec84fd46eed1577148ed4113f5998a36a18da4fce7170c37ce3e21b631393339 + url: "https://pub.dev" + source: hosted + version: "3.1.0" + audioplayers_windows: + dependency: transitive + description: + name: audioplayers_windows + sha256: "1d3aaac98a192b8488167711ba1e67d8b96333e8d0572ede4e2912e5bbce69a3" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + auto_size_text: + dependency: "direct main" + description: + name: auto_size_text + sha256: "3f5261cd3fb5f2a9ab4e2fc3fba84fd9fcaac8821f20a1d4e71f557521b22599" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + circular_reveal_animation: + dependency: "direct main" + description: + name: circular_reveal_animation + sha256: "198f5a1fa27384dcf950807e0ae07a0da857c04df6233f7468755ee9db102b0c" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + sha256: f1a06ad4499ed9ab73703560d44893e6b9e66ce3923c9121f4ef3981c972057f + url: "https://pub.dev" + source: hosted + version: "4.8.4" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + sha256: "86bd1865abbeb09a7d09da3e70364a09f894937270651fc611a1c6d6a9f7b02c" + url: "https://pub.dev" + source: hosted + version: "5.15.3" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + sha256: ac2eeb2a7ab1928c3aacc30eed750fa839d6f620e112a5459e321df217be2f47 + url: "https://pub.dev" + source: hosted + version: "3.6.3" + collection: + dependency: transitive + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + cross_file: + dependency: transitive + description: + name: cross_file + sha256: "0b0036e8cccbfbe0555fd83c1d31a6f30b77a96b598b35a5d36dd41f718695e9" + url: "https://pub.dev" + source: hosted + version: "0.3.3+4" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + custom_draggable_widget: + dependency: "direct main" + description: + name: custom_draggable_widget + sha256: "15718003ebcebb84acdf0c625831a880d139a284d8de9d943ef0d0a669f10159" + url: "https://pub.dev" + source: hosted + version: "0.0.2" + custom_refresh_indicator: + dependency: "direct main" + description: + name: custom_refresh_indicator + sha256: "65a463f09623f6baf75e45e0c9034e9304810be3f5dfb00a54edde7252f4a524" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "770eb1ab057b5ae4326d1c24cc57710758b9a46026349d021d6311bd27580046" + url: "https://pub.dev" + source: hosted + version: "0.9.2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "4ada532862917bf16e3adb3891fe3a5917a58bae03293e497082203a80909412" + url: "https://pub.dev" + source: hosted + version: "0.9.3+1" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: "412705a646a0ae90f33f37acfae6a0f7cbc02222d6cd34e479421c3e74d3853c" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "1372760c6b389842b77156203308940558a2817360154084368608413835fc26" + url: "https://pub.dev" + source: hosted + version: "0.9.3" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + sha256: "49fd35ce06f2530dd460e5dc123235731cb61dd7c76b0af4b6e190404880d04d" + url: "https://pub.dev" + source: hosted + version: "4.7.2" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + sha256: "817f3ceb84ef5e9adaaf50cf7a19255f6ffcdd12c6f9e9aa4cf00fc7f2eb3cfb" + url: "https://pub.dev" + source: hosted + version: "6.16.1" + firebase_auth_web: + dependency: transitive + description: + name: firebase_auth_web + sha256: e9044778287f1ff8f9f4cee7e247b03ec87bb8977e0e65ad27dc337e196132e8 + url: "https://pub.dev" + source: hosted + version: "5.6.2" + firebase_core: + dependency: "direct main" + description: + name: firebase_core + sha256: "2e9324f719e90200dc7d3c4f5d2abc26052f9f2b995d3b6626c47a0dfe1c8192" + url: "https://pub.dev" + source: hosted + version: "2.15.0" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + sha256: b63e3be6c96ef5c33bdec1aab23c91eb00696f6452f0519401d640938c94cba2 + url: "https://pub.dev" + source: hosted + version: "4.8.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + sha256: "0fd5c4b228de29b55fac38aed0d9e42514b3d3bd47675de52bf7f8fccaf922fa" + url: "https://pub.dev" + source: hosted + version: "2.6.0" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + sha256: "8ac91d83a028eef050de770f1dc98421e215714d245f34de7b154d436676fbd0" + url: "https://pub.dev" + source: hosted + version: "14.6.5" + firebase_messaging_platform_interface: + dependency: transitive + description: + name: firebase_messaging_platform_interface + sha256: b2995e3640efb646e9ebf0e2fa50dea84895f0746a31d7e3af0e5e009a533a1a + url: "https://pub.dev" + source: hosted + version: "4.5.4" + firebase_messaging_web: + dependency: transitive + description: + name: firebase_messaging_web + sha256: "5d8446a28339124a2cb4f57a6ca454a3aca7d0c5c0cdfa5707afb192f7c830a7" + url: "https://pub.dev" + source: hosted + version: "3.5.4" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + sha256: "4b747005aee0c611242cdd553f58795f51e1567d2dfd4f75692fac3f67c8c336" + url: "https://pub.dev" + source: hosted + version: "11.2.5" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + sha256: c77c7b6b7d283280993c81ea8ac95552b2ae521a7bb46a95181c1482e62d1633 + url: "https://pub.dev" + source: hosted + version: "4.4.4" + firebase_storage_web: + dependency: transitive + description: + name: firebase_storage_web + sha256: "6906245579f1af225e43df0395c9d9631cb3135cbfa3521a839196d3383bb89a" + url: "https://pub.dev" + source: hosted + version: "3.6.5" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_animated_play_button: + dependency: "direct main" + description: + name: flutter_animated_play_button + sha256: dd955a450a4514e935e2f410afbd03b3bcf5f31b933a8f1334199caa3c6a81e2 + url: "https://pub.dev" + source: hosted + version: "0.3.0" + flutter_countdown_timer: + dependency: "direct main" + description: + name: flutter_countdown_timer + sha256: dfcbd7d6f76a5589f78f3f3ba2f9ea2e199368eccc1adce4153ce985b9587bc5 + url: "https://pub.dev" + source: hosted + version: "4.1.0" + flutter_keyboard_visibility: + dependency: "direct main" + description: + name: flutter_keyboard_visibility + sha256: "4983655c26ab5b959252ee204c2fffa4afeb4413cd030455194ec0caa3b8e7cb" + url: "https://pub.dev" + source: hosted + version: "5.4.1" + flutter_keyboard_visibility_linux: + dependency: transitive + description: + name: flutter_keyboard_visibility_linux + sha256: "6fba7cd9bb033b6ddd8c2beb4c99ad02d728f1e6e6d9b9446667398b2ac39f08" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_macos: + dependency: transitive + description: + name: flutter_keyboard_visibility_macos + sha256: c5c49b16fff453dfdafdc16f26bdd8fb8d55812a1d50b0ce25fc8d9f2e53d086 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_keyboard_visibility_platform_interface: + dependency: transitive + description: + name: flutter_keyboard_visibility_platform_interface + sha256: e43a89845873f7be10cb3884345ceb9aebf00a659f479d1c8f4293fcb37022a4 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_web: + dependency: transitive + description: + name: flutter_keyboard_visibility_web + sha256: d3771a2e752880c79203f8d80658401d0c998e4183edca05a149f5098ce6e3d1 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_keyboard_visibility_windows: + dependency: transitive + description: + name: flutter_keyboard_visibility_windows + sha256: fc4b0f0b6be9b93ae527f3d527fb56ee2d918cd88bbca438c478af7bcfd0ef73 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "2118df84ef0c3ca93f96123a616ae8540879991b8b57af2f81b76a7ada49b2a4" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + flutter_plugin_android_lifecycle: + dependency: transitive + description: + name: flutter_plugin_android_lifecycle + sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" + url: "https://pub.dev" + source: hosted + version: "2.0.15" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + sha256: "1b61f8c4cbf965104b6ca7160880ff1af6755aad7fec70b58444245132453745" + url: "https://pub.dev" + source: hosted + version: "5.8.4" + flutter_signin_button: + dependency: "direct main" + description: + name: flutter_signin_button + sha256: a063ecc5d5308377e103c9c3a89084abf15fca4440636233af6a13abacd5dcae + url: "https://pub.dev" + source: hosted + version: "2.0.0" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: "8c5d68a82add3ca76d792f058b186a0599414f279f00ece4830b9b231b570338" + url: "https://pub.dev" + source: hosted + version: "2.0.7" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + font_awesome_flutter: + dependency: transitive + description: + name: font_awesome_flutter + sha256: "1f93e5799f0e6c882819e8393a05c6ca5226010f289190f2242ec19f3f0fdba5" + url: "https://pub.dev" + source: hosted + version: "9.2.0" + geolocator: + dependency: "direct main" + description: + name: geolocator + sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" + url: "https://pub.dev" + source: hosted + version: "9.0.2" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + sha256: b06c72853c993ae533f482d81a12805d7a441f5231d9668718bc7131d7464082 + url: "https://pub.dev" + source: hosted + version: "4.2.0" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: "36527c555f4c425f7d8fa8c7c07d67b78e3ff7590d40448051959e1860c1cfb4" + url: "https://pub.dev" + source: hosted + version: "2.2.7" + geolocator_platform_interface: + dependency: transitive + description: + name: geolocator_platform_interface + sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386 + url: "https://pub.dev" + source: hosted + version: "4.0.7" + geolocator_web: + dependency: transitive + description: + name: geolocator_web + sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 + url: "https://pub.dev" + source: hosted + version: "2.1.6" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d + url: "https://pub.dev" + source: hosted + version: "0.1.1" + google_fonts: + dependency: "direct main" + description: + name: google_fonts + sha256: "6b6f10f0ce3c42f6552d1c70d2c28d764cf22bb487f50f66cca31dcd5194f4d6" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + gradiantbutton: + dependency: "direct main" + description: + name: gradiantbutton + sha256: c88ac8567242630cd14231e2a6a861da4e40a02a9a0310af360e05634890d172 + url: "https://pub.dev" + source: hosted + version: "0.0.1" + gradient_borders: + dependency: "direct main" + description: + name: gradient_borders + sha256: "69eeaff519d145a4c6c213ada1abae386bcc8981a4970d923e478ce7ba19e309" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + image_picker: + dependency: "direct main" + description: + name: image_picker + sha256: "6296e98782726d37f59663f0727d0e978eee1ced1ffed45ccaba591786a7f7b3" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + image_picker_android: + dependency: transitive + description: + name: image_picker_android + sha256: "8179b54039b50eee561676232304f487602e2950ffb3e8995ed9034d6505ca34" + url: "https://pub.dev" + source: hosted + version: "0.8.7+4" + image_picker_for_web: + dependency: transitive + description: + name: image_picker_for_web + sha256: "869fe8a64771b7afbc99fc433a5f7be2fea4d1cb3d7c11a48b6b579eb9c797f0" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + image_picker_ios: + dependency: transitive + description: + name: image_picker_ios + sha256: b3e2f21feb28b24dd73a35d7ad6e83f568337c70afab5eabac876e23803f264b + url: "https://pub.dev" + source: hosted + version: "0.8.8" + image_picker_linux: + dependency: transitive + description: + name: image_picker_linux + sha256: "02cbc21fe1706b97942b575966e5fbbeaac535e76deef70d3a242e4afb857831" + url: "https://pub.dev" + source: hosted + version: "0.2.1" + image_picker_macos: + dependency: transitive + description: + name: image_picker_macos + sha256: cee2aa86c56780c13af2c77b5f2f72973464db204569e1ba2dd744459a065af4 + url: "https://pub.dev" + source: hosted + version: "0.2.1" + image_picker_platform_interface: + dependency: transitive + description: + name: image_picker_platform_interface + sha256: c1134543ae2187e85299996d21c526b2f403854994026d575ae4cf30d7bb2a32 + url: "https://pub.dev" + source: hosted + version: "2.9.0" + image_picker_windows: + dependency: transitive + description: + name: image_picker_windows + sha256: c3066601ea42113922232c7b7b3330a2d86f029f685bba99d82c30e799914952 + url: "https://pub.dev" + source: hosted + version: "0.2.1" + insta_image_viewer: + dependency: "direct main" + description: + name: insta_image_viewer + sha256: "9a81432b1ab907ea91c255ec079440afe43f999533422badffaa482dfb7fdfbb" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + intl: + dependency: "direct main" + description: + name: intl + sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + url: "https://pub.dev" + source: hosted + version: "0.18.1" + ionicons: + dependency: "direct main" + description: + name: ionicons + sha256: "5496bc65a16115ecf05b15b78f494ee4a8869504357668f0a11d689e970523cf" + url: "https://pub.dev" + source: hosted + version: "0.2.2" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + lottie: + dependency: "direct main" + description: + name: lottie + sha256: "0793a5866062e5cc8a8b24892fa94c3095953ea914a7fdf790f550dd7537fe60" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + modal_bottom_sheet: + dependency: "direct main" + description: + name: modal_bottom_sheet + sha256: ef533916a2c3089571c32bd34e410faca77a6849a3f28f748e0794525c5658a0 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + path: + dependency: transitive + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + url: "https://pub.dev" + source: hosted + version: "2.0.15" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + url: "https://pub.dev" + source: hosted + version: "2.0.27" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "916731ccbdce44d545414dd9961f26ba5fbaa74bcbb55237d8e65a623a8c7297" + url: "https://pub.dev" + source: hosted + version: "2.2.4" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + url: "https://pub.dev" + source: hosted + version: "2.1.11" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + url: "https://pub.dev" + source: hosted + version: "2.0.6" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + url: "https://pub.dev" + source: hosted + version: "2.1.7" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + url: "https://pub.dev" + source: hosted + version: "5.4.0" + pinch_zoom: + dependency: "direct main" + description: + name: pinch_zoom + sha256: ad12872281742726afaf03438d99a4572c584a612630768953beb6dfd6f9389a + url: "https://pub.dev" + source: hosted + version: "1.0.0" + platform: + dependency: transitive + description: + name: platform + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "43798d895c929056255600343db8f049921cbec94d31ec87f1dc5c16c01935dd" + url: "https://pub.dev" + source: hosted + version: "2.1.5" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + smooth_corner: + dependency: "direct main" + description: + name: smooth_corner + sha256: "1e920cffd9644d6f51f9a99674652f8c00f2e9074b275f3edde0de1441ba78e9" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + smooth_list_view: + dependency: "direct main" + description: + name: smooth_list_view + sha256: d6eb3bed78881c50d4574b0dd466ed3321972477688c1c021178f3132155112a + url: "https://pub.dev" + source: hosted + version: "1.0.4" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + synchronized: + dependency: transitive + description: + name: synchronized + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + text_scroll: + dependency: "direct main" + description: + name: text_scroll + sha256: "7869d86a6fdd725dee56bdd150216a99f0372b82fbfcac319214dbd5f36e1908" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + timezone: + dependency: "direct main" + description: + name: timezone + sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0" + url: "https://pub.dev" + source: hosted + version: "0.9.2" + top_snackbar_flutter: + dependency: "direct main" + description: + name: top_snackbar_flutter + sha256: "22d14664a13db6ac714934c3382bd8d4daa57fb888a672f922df71981c5a5cb2" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + tuple: + dependency: "direct main" + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: "670f6e07aca990b4a2bcdc08a784193c4ccdd1932620244c3a86bb72a0eac67f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: "7451721781d967db9933b63f5733b1c4533022c0ba373a01bdd79d1a5457f69f" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "80a13c613c8bde758b1464a1755a7b3a8f2b6cec61fbf0f5a53c94c30f03ba2e" + url: "https://pub.dev" + source: hosted + version: "1.1.7" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + win32: + dependency: transitive + description: + name: win32 + sha256: f2add6fa510d3ae152903412227bda57d0d5a8da61d2c39c1fb022c9429a41c0 + url: "https://pub.dev" + source: hosted + version: "5.0.6" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: e0b1147eec179d3911f1f19b59206448f78195ca1d20514134e10641b7d7fbff + url: "https://pub.dev" + source: hosted + version: "1.0.1" + xml: + dependency: transitive + description: + name: xml + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + url: "https://pub.dev" + source: hosted + version: "6.3.0" + zoom_tap_animation: + dependency: "direct main" + description: + name: zoom_tap_animation + sha256: d9f7a73cab65aa1546ba6886b5e21d3c8ccccb34e4e5f770301c306d4868bee0 + url: "https://pub.dev" + source: hosted + version: "1.1.0" +sdks: + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" diff --git a/Sources/justMUSIC/pubspec.yaml b/Sources/justMUSIC/pubspec.yaml index 3f7f94a..ae178c7 100644 --- a/Sources/justMUSIC/pubspec.yaml +++ b/Sources/justMUSIC/pubspec.yaml @@ -73,6 +73,7 @@ dependencies: flutter_svg: ^2.0.7 flutter_keyboard_visibility: ^5.4.1 timezone: ^0.9.2 + firebase_messaging: ^14.6.5 dev_dependencies: flutter_test: diff --git a/Sources/justMUSIC/test/Notification_test.dart b/Sources/justMUSIC/test/Notification_test.dart new file mode 100644 index 0000000..458bb1e --- /dev/null +++ b/Sources/justMUSIC/test/Notification_test.dart @@ -0,0 +1,6 @@ +import 'package:justmusic/services/NotificationService.dart'; + +Future main() async { + var notif = NotificationService(); + await notif.sendPushMessage("cAJAJw_aR7yPQbFTMS-r6H:APA91bEZs34Ab3-xSYeIGykHrxD5pRj-OyODaEcNBPtds1eLzEH0uzFkzCSQY7BvZQHEFPfeHSN7nri4webskXbu1zzgwe9NIdPagsc6IHaouuewWqWd9V7ucTeDeYt1Sbby4-pb6jtA", "Just Music", "Vien voir les nouveautés"); +} \ No newline at end of file