Refactoring + Checkpoint
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Bouton de soumission avec un gradient visuel et des ombres
|
||||
/// Utilisé pour l'envoi d'un formulaire d'événement
|
||||
class SubmitButton extends StatelessWidget {
|
||||
/// Fonction à exécuter lors de l'appui sur le bouton
|
||||
final VoidCallback onPressed;
|
||||
|
||||
const SubmitButton({Key? key, required this.onPressed}) : super(key: key);
|
||||
@@ -8,11 +11,12 @@ class SubmitButton extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
// Décoration du bouton avec un dégradé de couleurs et une ombre
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
Color(0xFF1DBF73), // Start of the gradient
|
||||
Color(0xFF11998E), // End of the gradient
|
||||
Color(0xFF1DBF73), // Dégradé vert clair
|
||||
Color(0xFF11998E), // Dégradé vert foncé
|
||||
],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
@@ -22,18 +26,18 @@ class SubmitButton extends StatelessWidget {
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
spreadRadius: 2,
|
||||
blurRadius: 8,
|
||||
offset: const Offset(2, 4), // Shadow position
|
||||
offset: const Offset(2, 4), // Position de l'ombre
|
||||
),
|
||||
],
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
onPressed: onPressed, // Appel de la fonction passée en paramètre
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.transparent, // Button background is transparent to show gradient
|
||||
shadowColor: Colors.transparent, // Remove the default shadow
|
||||
backgroundColor: Colors.transparent, // Fond transparent pour voir le dégradé
|
||||
shadowColor: Colors.transparent, // Suppression de l'ombre par défaut
|
||||
padding: const EdgeInsets.symmetric(vertical: 14.0),
|
||||
minimumSize: const Size(double.infinity, 50), // Bigger button size
|
||||
minimumSize: const Size(double.infinity, 50), // Taille du bouton
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8.0),
|
||||
),
|
||||
@@ -41,10 +45,10 @@ class SubmitButton extends StatelessWidget {
|
||||
child: const Text(
|
||||
'Créer l\'événement',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 16, // Increase font size
|
||||
fontWeight: FontWeight.bold, // Bold text
|
||||
letterSpacing: 1.2, // Spacing between letters
|
||||
color: Colors.white, // Couleur du texte
|
||||
fontSize: 16, // Taille du texte
|
||||
fontWeight: FontWeight.bold, // Texte en gras
|
||||
letterSpacing: 1.2, // Espacement entre les lettres
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user