103 lines
2.9 KiB
Dart
103 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
import '../../../core/theme/app_colors.dart';
|
|
|
|
|
|
|
|
/// Fond et carte pour les écrans d'authentification.
|
|
|
|
class AuthScaffold extends StatelessWidget {
|
|
|
|
const AuthScaffold({
|
|
|
|
super.key,
|
|
|
|
required this.child,
|
|
|
|
this.showBackButton = false,
|
|
|
|
});
|
|
|
|
|
|
|
|
final Widget child;
|
|
|
|
final bool showBackButton;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
|
|
|
body: Container(
|
|
|
|
decoration: const BoxDecoration(gradient: AppColors.gradientSoft),
|
|
|
|
child: SafeArea(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
if (showBackButton)
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: IconButton(
|
|
|
|
onPressed: () => Navigator.of(context).maybePop(),
|
|
|
|
icon: const Icon(Icons.arrow_back),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Center(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
padding: const EdgeInsets.all(24),
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Carte blanche pour formulaires auth.
|
|
|
|
class AuthFormCard extends StatelessWidget {
|
|
|
|
const AuthFormCard({super.key, required this.child});
|
|
|
|
|
|
|
|
final Widget child;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return ConstrainedBox(
|
|
|
|
constraints: const BoxConstraints(maxWidth: 420),
|
|
|
|
child: Card(
|
|
|
|
elevation: 2,
|
|
|
|
shadowColor: Colors.black.withValues(alpha: 0.08),
|
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
|
|
|
|
child: Padding(
|
|
|
|
padding: const EdgeInsets.all(24),
|
|
|
|
child: child,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Logo et titre auth.
|
|
|
|
class AuthHeader extends StatelessWidget {
|
|
|
|
const AuthHeader({super.key, required this.subtitle});
|
|
|
|
|
|
|
|
final String subtitle;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: 64,
|
|
|
|
height: 64,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
gradient: AppColors.gradientPrimary,
|
|
|
|
borderRadius: BorderRadius.circular(16),
|
|
|
|
),
|
|
|
|
child: const Icon(Icons.local_laundry_service_outlined, size: 32, color: Colors.white),
|
|
|
|
),
|
|
|
|
const SizedBox(height: 16),
|
|
|
|
Text(
|
|
|
|
'Laverie Connectée',
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: Theme.of(context).textTheme.headlineMedium,
|
|
|
|
),
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
Text(subtitle, textAlign: TextAlign.center, style: Theme.of(context).textTheme.bodyMedium),
|
|
|
|
const SizedBox(height: 24),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|