diff --git a/Sources/justMUSIC/lib/components/Finish_button.dart b/Sources/justMUSIC/lib/components/Finish_button.dart index e6dc6e6..bb438f4 100644 --- a/Sources/justMUSIC/lib/components/Finish_button.dart +++ b/Sources/justMUSIC/lib/components/Finish_button.dart @@ -13,7 +13,9 @@ class _FinishButtonState extends State { @override Widget build(BuildContext context) { return ElevatedButton( - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, '/feed'); + }, style: ButtonStyle( backgroundColor: MaterialStateProperty.all(Color(0xFF1C1C1C)), overlayColor: diff --git a/Sources/justMUSIC/lib/components/join_button.dart b/Sources/justMUSIC/lib/components/join_button.dart index 1c141e6..4b64e7e 100644 --- a/Sources/justMUSIC/lib/components/join_button.dart +++ b/Sources/justMUSIC/lib/components/join_button.dart @@ -8,7 +8,9 @@ class JoinButton extends StatelessWidget { @override Widget build(BuildContext context) { return ElevatedButton( - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, '/register'); + }, child: Text( "Rejoindre", style: GoogleFonts.plusJakartaSans( diff --git a/Sources/justMUSIC/lib/components/login_button.dart b/Sources/justMUSIC/lib/components/login_button.dart index badf09f..3e41e8e 100644 --- a/Sources/justMUSIC/lib/components/login_button.dart +++ b/Sources/justMUSIC/lib/components/login_button.dart @@ -13,7 +13,9 @@ class _LoginButtonState extends State { @override Widget build(BuildContext context) { return ElevatedButton( - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, '/explanation'); + }, style: ButtonStyle( backgroundColor: MaterialStateProperty.all(Color(0xFF1C1C1C)), overlayColor: diff --git a/Sources/justMUSIC/lib/components/post_component.dart b/Sources/justMUSIC/lib/components/post_component.dart index 428ac9d..7d47b8d 100644 --- a/Sources/justMUSIC/lib/components/post_component.dart +++ b/Sources/justMUSIC/lib/components/post_component.dart @@ -158,7 +158,7 @@ class _PostComponentState extends State { ), ), )), - SizedBox(height: 10), + SizedBox(height: 15), Row( crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -363,7 +363,7 @@ class _PostComponentState extends State { ), ), )), - SizedBox(height: 10), + SizedBox(height: 15), Row( crossAxisAlignment: CrossAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.spaceBetween, diff --git a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart index e681dee..8af5c71 100644 --- a/Sources/justMUSIC/lib/components/top_nav_bar_component.dart +++ b/Sources/justMUSIC/lib/components/top_nav_bar_component.dart @@ -124,12 +124,17 @@ class _TopNavBarComponentState extends State { ), Flexible( flex: 1, - child: ClipOval( - child: SizedBox.fromSize( - // Image radius - child: Image( - image: AssetImage("assets/images/exemple_profile.png"), - width: 25, + child: GestureDetector( + onTap: () { + Navigator.pushNamed(context, '/profile'); + }, + child: ClipOval( + child: SizedBox.fromSize( + // Image radius + child: Image( + image: AssetImage("assets/images/exemple_profile.png"), + width: 25, + ), ), ), ), diff --git a/Sources/justMUSIC/lib/main.dart b/Sources/justMUSIC/lib/main.dart index a9a9de3..52ff98e 100644 --- a/Sources/justMUSIC/lib/main.dart +++ b/Sources/justMUSIC/lib/main.dart @@ -1,7 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:justmusic/screens/explanations_screen.dart'; import 'package:justmusic/screens/feed_screen.dart'; +import 'package:justmusic/screens/login_screen.dart'; +import 'package:justmusic/screens/post_screen.dart'; +import 'package:justmusic/screens/profile_screen.dart'; +import 'package:justmusic/screens/registration_screen.dart'; +import 'package:justmusic/screens/welcome_screen.dart'; import 'package:justmusic/view_model/UserViewModel.dart'; void main() { @@ -20,6 +26,15 @@ class MyApp extends StatelessWidget { return ScreenUtilInit( builder: (context, child) { return MaterialApp( + routes: { + '/welcome': (context) => WellcomeScreen(), + '/feed': (context) => FeedScreen(), + '/login': (context) => LoginScreen(), + '/register': (context) => RegistrationScreen(), + '/post': (context) => PostScreen(), + '/profile': (context) => ProfileScreen(), + '/explanation': (context) => ExplanationsScreen(), + }, debugShowCheckedModeBanner: false, theme: ThemeData( // This is the theme of your application. @@ -33,9 +48,7 @@ class MyApp extends StatelessWidget { // is not restarted. primarySwatch: Colors.blue, ), - home: const SafeArea( - child: FeedScreen(), - )); + home: WellcomeScreen()); }, designSize: Size(390, 844), ); diff --git a/Sources/justMUSIC/lib/screens/feed_screen.dart b/Sources/justMUSIC/lib/screens/feed_screen.dart index d26be5f..39b4f7c 100644 --- a/Sources/justMUSIC/lib/screens/feed_screen.dart +++ b/Sources/justMUSIC/lib/screens/feed_screen.dart @@ -1,6 +1,7 @@ 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 '../components/comment_component.dart'; @@ -52,6 +53,12 @@ class _FeedScreenState extends State animationController.forward(); } + Future resetFullScreen() async { + await SystemChannels.platform.invokeMethod( + 'SystemChrome.restoreSystemUIOverlays', + ); + } + void changeFeed(bool choice) { // Mettez ici le code pour l'action que vous souhaitez effectuer avec le paramètre if (choice) { @@ -82,74 +89,146 @@ class _FeedScreenState extends State borderRadius: BorderRadius.only( topLeft: Radius.circular(20), topRight: Radius.circular(20))), builder: ((context) { - return Container( - height: 720.h, - margin: const EdgeInsets.only(top: 10), - child: Column( - children: [ - Align( - child: Container( - width: 60, - height: 5, - decoration: BoxDecoration( - color: Colors.white.withOpacity(0.3), - borderRadius: BorderRadius.circular(20))), - ), - const SizedBox( - height: 20, - ), - Expanded( - child: ClipRRect( - borderRadius: BorderRadius.only( - topRight: Radius.circular(15), - topLeft: Radius.circular(15)), - child: Padding( - padding: EdgeInsets.only( - left: defaultPadding, right: defaultPadding), - child: SingleChildScrollView( - child: Wrap( - // to apply margin in the main axis of the wrap - runSpacing: 10, - children: [ - PostComponent( - callback: null, - ), - Container(height: 10), - Align( - child: RichText( - text: TextSpan( - text: "3", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, - fontWeight: FontWeight.w600), - children: [ - TextSpan( - text: " commentaires", - style: GoogleFonts.plusJakartaSans( - color: Colors.white, - fontWeight: FontWeight.w300), - ) - ])), - ), - SizedBox(height: 20), - CommentComponent(), - CommentComponent(), - CommentComponent(), - Container(height: 10), - ], + return GestureDetector( + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + resetFullScreen(); + } + }, + child: Container( + height: 720.h, + margin: const EdgeInsets.only(top: 10), + child: Column( + children: [ + Align( + child: Container( + width: 60, + height: 5, + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.3), + borderRadius: BorderRadius.circular(20))), + ), + const SizedBox( + height: 20, + ), + Expanded( + child: ClipRRect( + borderRadius: BorderRadius.only( + topRight: Radius.circular(15), + topLeft: Radius.circular(15)), + child: Padding( + padding: EdgeInsets.only( + left: defaultPadding, right: defaultPadding), + child: SingleChildScrollView( + child: Wrap( + // to apply margin in the main axis of the wrap + runSpacing: 10, + children: [ + PostComponent( + callback: null, + ), + Container(height: 10), + Align( + child: RichText( + text: TextSpan( + text: "3", + style: GoogleFonts.plusJakartaSans( + color: Colors.white, + fontWeight: FontWeight.w600), + children: [ + TextSpan( + text: " commentaires", + style: GoogleFonts.plusJakartaSans( + color: Colors.white, + fontWeight: FontWeight.w300), + ) + ])), + ), + SizedBox(height: 20), + CommentComponent(), + CommentComponent(), + CommentComponent(), + Container(height: 10), + ], + ), ), ), ), ), - ), - Container( - padding: EdgeInsets.only(top: 300), - height: 70, - width: double.infinity, - color: Colors.grey, - child: TextField(), - ), - ], + Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).viewInsets.bottom), + child: Container( + height: 70, + width: double.infinity, + decoration: BoxDecoration( + border: Border( + top: BorderSide(color: grayColor, width: 2)), + color: textFieldMessage), + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Row( + children: [ + ClipOval( + child: SizedBox.fromSize( + // Image radius + child: const Image( + image: AssetImage( + "assets/images/exemple_profile.png"), + width: 45, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: TextField( + keyboardAppearance: Brightness.dark, + cursorColor: primaryColor, + keyboardType: TextInputType.emailAddress, + style: GoogleFonts.plusJakartaSans( + color: Colors.white), + decoration: InputDecoration( + suffixIcon: Icon( + Icons.send, + color: grayText, + size: 20, + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + width: 1, color: grayText), + borderRadius: BorderRadius.all( + Radius.circular(100))), + 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))), + hintText: 'Ajoutez une réponse...', + hintStyle: GoogleFonts.plusJakartaSans( + color: grayText)), + ), + ) + ], + ), + ), + )), + ), + ], + ), ), ); }), @@ -159,6 +238,7 @@ class _FeedScreenState extends State @override Widget build(BuildContext context) { return Scaffold( + resizeToAvoidBottomInset: true, backgroundColor: bgColor, body: Stack( children: [ diff --git a/Sources/justMUSIC/lib/screens/profile_screen.dart b/Sources/justMUSIC/lib/screens/profile_screen.dart index a98b6e5..0a046af 100644 --- a/Sources/justMUSIC/lib/screens/profile_screen.dart +++ b/Sources/justMUSIC/lib/screens/profile_screen.dart @@ -29,9 +29,14 @@ class _ProfileScreenState extends State { child: Stack( alignment: Alignment.centerLeft, children: [ - Image( - image: AssetImage("assets/images/return_icon.png"), - height: 11.h, + GestureDetector( + onTap: () { + Navigator.pop(context); + }, + child: Image( + image: AssetImage("assets/images/return_icon.png"), + height: 11.h, + ), ), Align( child: Text( diff --git a/Sources/justMUSIC/lib/values/constants.dart b/Sources/justMUSIC/lib/values/constants.dart index 4940a15..f29ef36 100644 --- a/Sources/justMUSIC/lib/values/constants.dart +++ b/Sources/justMUSIC/lib/values/constants.dart @@ -14,6 +14,7 @@ const strokeTextField = Color(0xFF373546); const unactiveFeed = Color(0xFF848484); const gradiantPost = Color(0xFF0D0D0D); const bgModal = Color(0xFF1E1E1E); +const textFieldMessage = Color(0xFF232323); const bgComment = Color(0xFF222222); const bgAppBar = Color(0xFF181818); const grayText = Color(0xFF898989);