From aaf7070757ac7982d3e7361684b504018ea69707 Mon Sep 17 00:00:00 2001 From: Julien Martin Date: Wed, 30 Apr 2025 18:38:04 +0200 Subject: [PATCH] =?UTF-8?q?feat(login):=20=E2=9C=A8=20Ajoutdes=20champs=20?= =?UTF-8?q?de=20formulaire=20et=20du=20bouton=20de=20connexion=20-=20Image?= =?UTF-8?q?s=20field=5Femail,=20field=5Fpassword=20et=20btn=5Fgreen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/lib/screens/auth/login_screen.dart | 85 ++++++++++++++++++++- frontend/pubspec.yaml | 3 + 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/frontend/lib/screens/auth/login_screen.dart b/frontend/lib/screens/auth/login_screen.dart index 6468a02..48df1bd 100644 --- a/frontend/lib/screens/auth/login_screen.dart +++ b/frontend/lib/screens/auth/login_screen.dart @@ -51,9 +51,42 @@ class LoginPage extends StatelessWidget { fit: BoxFit.contain, ), ), - // Contenu - const Center( - child: Text('Formulaire de connexion à implémenter'), + // Formulaire + Positioned( + left: leftMargin + imageWidth + (remainingWidth - leftMargin) / 2 - 200, + top: h * 0.3, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // Champ email + _ImageTextField( + bg: 'assets/images/field_email.png', + width: 400, + height: 80, + hint: 'Email', + ), + const SizedBox(height: 20), + // Champ mot de passe + _ImageTextField( + bg: 'assets/images/field_password.png', + width: 400, + height: 80, + hint: 'Mot de passe', + obscure: true, + ), + const SizedBox(height: 30), + // Bouton de connexion + _ImageButton( + bg: 'assets/images/btn_green.png', + width: 400, + height: 80, + text: 'Se connecter', + onPressed: () { + // TODO: Implémenter la logique de connexion + }, + ), + ], + ), ), ], ); @@ -137,4 +170,50 @@ class _ImageTextField extends StatelessWidget { ), ); } +} + +// ─────────────────────────────────────────────────────────────── +// Bouton avec fond image +// ─────────────────────────────────────────────────────────────── +class _ImageButton extends StatelessWidget { + final String bg; + final double width; + final double height; + final String text; + final VoidCallback onPressed; + const _ImageButton({ + required this.bg, + required this.width, + required this.height, + required this.text, + required this.onPressed, + }); + + @override + Widget build(BuildContext context) { + return SizedBox( + width: width, + height: height, + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: onPressed, + child: Stack( + children: [ + Positioned.fill(child: Image.asset(bg, fit: BoxFit.fill)), + Center( + child: Text( + text, + style: GoogleFonts.merienda( + fontSize: width * 0.045, + color: Colors.white, + ), + ), + ), + ], + ), + ), + ), + ); + } } \ No newline at end of file diff --git a/frontend/pubspec.yaml b/frontend/pubspec.yaml index 2bfc58b..cbf80a7 100644 --- a/frontend/pubspec.yaml +++ b/frontend/pubspec.yaml @@ -28,6 +28,9 @@ flutter: - assets/images/logo.png - assets/images/river_logo_desktop.png - assets/images/paper2.png + - assets/images/field_email.png + - assets/images/field_password.png + - assets/images/btn_green.png fonts: - family: Merienda