From 60ee9d2700593906973ba37a2b0159477def5567 Mon Sep 17 00:00:00 2001 From: Lucas Delanier Date: Mon, 31 Jul 2023 01:34:22 +0200 Subject: [PATCH] post capsule :sparkles: --- .../components/editable_post_component.dart | 2 +- .../lib/components/post_button_component.dart | 138 +++++++++--------- .../justMUSIC/lib/screens/post_screen.dart | 2 - .../justMUSIC/lib/services/PostService.dart | 4 - 4 files changed, 71 insertions(+), 75 deletions(-) diff --git a/Sources/justMUSIC/lib/components/editable_post_component.dart b/Sources/justMUSIC/lib/components/editable_post_component.dart index 107116b..52fa145 100644 --- a/Sources/justMUSIC/lib/components/editable_post_component.dart +++ b/Sources/justMUSIC/lib/components/editable_post_component.dart @@ -248,7 +248,7 @@ class _EditablePostComponentState extends State )), Container(width: 10), AutoSizeText( - "2013", + widget.music?.date.toString() ?? "unknown", style: GoogleFonts.plusJakartaSans( color: Colors.white.withOpacity(0.5), fontWeight: FontWeight.w300, diff --git a/Sources/justMUSIC/lib/components/post_button_component.dart b/Sources/justMUSIC/lib/components/post_button_component.dart index e8db142..a82dd98 100644 --- a/Sources/justMUSIC/lib/components/post_button_component.dart +++ b/Sources/justMUSIC/lib/components/post_button_component.dart @@ -81,81 +81,83 @@ class _PostButtonComponentState extends State decoration: BoxDecoration( color: Colors.transparent, borderRadius: BorderRadius.circular(1000)), - child: Stack( - children: [ - AnimatedBuilder( - animation: _controller, - builder: (context, child) { - return Transform.translate( - offset: Offset( - _controller.value * - (MediaQuery.of(context).size.width - 200), - 0, + child: Align( + child: Stack( + children: [ + AnimatedBuilder( + animation: _controller, + builder: (context, child) { + return Transform.translate( + offset: Offset( + 20 + _controller.value * (240), + 0, + ), + child: child, + ); + }, + child: Container( + width: 120, + height: 80, + alignment: Alignment.center, + decoration: BoxDecoration( + gradient: LinearGradient(colors: [ + Color(0xFF9E78FF).withOpacity(0.0), + Color(0xFFFDFDFF), + Color(0xFFFFFFFF), + Color(0xFF9E78FF).withOpacity(0.0) + ], stops: const [ + 0, + 0.4, + 0.5, + 1 + ]), ), - child: child, - ); - }, - child: Container( - width: 120, - height: 80, - alignment: Alignment.center, - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Color(0xFF9E78FF).withOpacity(0.0), - Color(0xFFFDFDFF), - Color(0xFFFFFFFF), - Color(0xFF9E78FF).withOpacity(0.0) - ], stops: const [ - 0, - 0.4, - 0.5, - 1 - ]), ), ), - ), - BackdropFilter( - filter: ImageFilter.blur( - sigmaX: 10.0, - sigmaY: 10.0, - ), - child: Opacity( - opacity: 0.9, - child: Container( - constraints: BoxConstraints(maxWidth: 400), - decoration: BoxDecoration( - gradient: LinearGradient(colors: [ - Color(0xFF633AF4), - Color(0xFF9367FF), - Color(0xFF633AF4) - ]), - border: Border.all(width: 5, color: Color(0xFF1C1C1C)), - borderRadius: BorderRadius.circular(10000)), - padding: EdgeInsets.symmetric(vertical: 25), - width: double.infinity, - child: Padding( - padding: EdgeInsets.only(left: 100), - child: Text( - "Publier la capsule", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, - fontWeight: FontWeight.w700, - fontStyle: FontStyle.italic, - fontSize: 22), + BackdropFilter( + filter: ImageFilter.blur( + sigmaX: 10.0, + sigmaY: 10.0, + ), + child: Opacity( + opacity: 0.9, + child: Container( + constraints: BoxConstraints(maxWidth: 400), + decoration: BoxDecoration( + gradient: LinearGradient(colors: [ + Color(0xFF633AF4), + Color(0xFF9367FF), + Color(0xFF633AF4) + ]), + border: + Border.all(width: 5, color: Color(0xFF1C1C1C)), + borderRadius: BorderRadius.circular(10000)), + padding: EdgeInsets.symmetric(vertical: 25), + width: double.infinity, + child: Padding( + padding: EdgeInsets.only(left: 100), + child: Text( + "Publier la capsule", + style: GoogleFonts.plusJakartaSans( + color: Colors.white, + fontWeight: FontWeight.w700, + fontStyle: FontStyle.italic, + fontSize: 22), + ), ), ), + )), + ClipOval( + child: Padding( + padding: const EdgeInsets.only(left: 5, top: 5), + child: Image( + image: AssetImage("assets/images/rocket_button.png"), + height: 65, ), - )), - ClipOval( - child: Padding( - padding: const EdgeInsets.only(left: 5, top: 5), - child: Image( - image: AssetImage("assets/images/rocket_button.png"), - height: 65, ), - ), - ) - ], + ) + ], + ), ), ), ); diff --git a/Sources/justMUSIC/lib/screens/post_screen.dart b/Sources/justMUSIC/lib/screens/post_screen.dart index c3fb4d1..ac94942 100644 --- a/Sources/justMUSIC/lib/screens/post_screen.dart +++ b/Sources/justMUSIC/lib/screens/post_screen.dart @@ -94,10 +94,8 @@ class _PostScreenState extends State } handleSubmit() async { - print("ccccccccccccc"); await MyApp.postViewModel.addPost( description, (selectedMusic?.id)!, selectedImage, selectedCity); - print("ccccccccccccc"); quit(); } diff --git a/Sources/justMUSIC/lib/services/PostService.dart b/Sources/justMUSIC/lib/services/PostService.dart index 4a305a8..e46d45e 100644 --- a/Sources/justMUSIC/lib/services/PostService.dart +++ b/Sources/justMUSIC/lib/services/PostService.dart @@ -19,16 +19,12 @@ class PostService { }; var postAdd = await MyApp.db.collection("posts").add(post); - print("cc"); if (image != null) { - print("cc3"); var imageRef = FirebaseStorage.instance.ref('$id${postAdd.id}.jpg'); await imageRef.putFile(image); var imageUrl = await imageRef.getDownloadURL(); - print(imageUrl); postAdd.update({"selfie": imageUrl}); } - print("cc2"); } deletePost() {}