Files
unionflow-server-api/unionflow-mobile-apps/lib/features/search/presentation/pages/advanced_search_page.dart
2025-09-20 03:56:11 +00:00

117 lines
3.4 KiB
Dart

import 'package:flutter/material.dart';
/// Page de recherche avancée des membres
class AdvancedSearchPage extends StatefulWidget {
const AdvancedSearchPage({super.key});
@override
State<AdvancedSearchPage> createState() => _AdvancedSearchPageState();
}
class _AdvancedSearchPageState extends State<AdvancedSearchPage> {
final _formKey = GlobalKey<FormState>();
final _queryController = TextEditingController();
final _nomController = TextEditingController();
final _prenomController = TextEditingController();
final _emailController = TextEditingController();
@override
void dispose() {
_queryController.dispose();
_nomController.dispose();
_prenomController.dispose();
_emailController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Recherche Avancée'),
backgroundColor: Theme.of(context).primaryColor,
foregroundColor: Colors.white,
),
body: Form(
key: _formKey,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
TextFormField(
controller: _queryController,
decoration: const InputDecoration(
labelText: 'Recherche générale',
hintText: 'Nom, prénom, email...',
prefixIcon: Icon(Icons.search),
),
),
const SizedBox(height: 16),
TextFormField(
controller: _nomController,
decoration: const InputDecoration(
labelText: 'Nom',
prefixIcon: Icon(Icons.person),
),
),
const SizedBox(height: 16),
TextFormField(
controller: _prenomController,
decoration: const InputDecoration(
labelText: 'Prénom',
prefixIcon: Icon(Icons.person_outline),
),
),
const SizedBox(height: 16),
TextFormField(
controller: _emailController,
decoration: const InputDecoration(
labelText: 'Email',
prefixIcon: Icon(Icons.email),
),
keyboardType: TextInputType.emailAddress,
),
const SizedBox(height: 32),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: _performSearch,
child: const Text('Rechercher'),
),
),
const SizedBox(width: 16),
Expanded(
child: OutlinedButton(
onPressed: _clearForm,
child: const Text('Effacer'),
),
),
],
),
],
),
),
),
);
}
void _performSearch() {
if (_formKey.currentState!.validate()) {
// TODO: Implémenter la recherche
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Recherche en cours...'),
),
);
}
}
void _clearForm() {
_queryController.clear();
_nomController.clear();
_prenomController.clear();
_emailController.clear();
}
}