feat(inscription AM #120): UI étape pro, photo unifiée, scripts et données test
- Panneau AM : validation NIR alignée API, date d’agrément requise côté app, capacité 1–10, n° agrément + date sur une ligne, ville/pays formatés au blur. - Widget RegistrationPhotoSlot (cadre, croix) partagé avec les cartes enfant. - AuthService : MIME PNG/JPEG pour la photo ; payload date_agrement. - Scripts register-am-dubois / mansouri ; chemins tests/ressources/photos ; doc test-data + seed ; smoke curl inscription AM. Made-with: Cursor
This commit is contained in:
@@ -10,12 +10,14 @@ import 'dart:io';
|
||||
import '../models/card_assets.dart';
|
||||
import '../config/display_config.dart';
|
||||
import '../utils/nir_utils.dart';
|
||||
import '../utils/name_format_utils.dart';
|
||||
import 'custom_app_text_field.dart';
|
||||
import 'nir_text_field.dart';
|
||||
import 'form_field_wrapper.dart';
|
||||
import 'app_custom_checkbox.dart';
|
||||
import 'hover_relief_widget.dart';
|
||||
import 'custom_navigation_button.dart';
|
||||
import 'registration_photo_slot.dart';
|
||||
|
||||
/// Données pour le formulaire d'informations professionnelles
|
||||
class ProfessionalInfoData {
|
||||
@@ -29,6 +31,8 @@ class ProfessionalInfoData {
|
||||
final String birthCountry;
|
||||
final String nir;
|
||||
final String agrementNumber;
|
||||
/// Date d'obtention de l'agrément (obligatoire, API `date_agrement`).
|
||||
final DateTime? agreementDate;
|
||||
final int? capacity;
|
||||
|
||||
ProfessionalInfoData({
|
||||
@@ -42,6 +46,7 @@ class ProfessionalInfoData {
|
||||
this.birthCountry = '',
|
||||
this.nir = '',
|
||||
this.agrementNumber = '',
|
||||
this.agreementDate,
|
||||
this.capacity,
|
||||
});
|
||||
}
|
||||
@@ -87,9 +92,14 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
final _birthCountryController = TextEditingController();
|
||||
final _nirController = TextEditingController();
|
||||
final _agrementController = TextEditingController();
|
||||
final _agreementDateController = TextEditingController();
|
||||
final _capacityController = TextEditingController();
|
||||
|
||||
FocusNode? _birthCityFocus;
|
||||
FocusNode? _birthCountryFocus;
|
||||
|
||||
DateTime? _selectedDate;
|
||||
DateTime? _selectedAgreementDate;
|
||||
String? _photoPathFramework;
|
||||
File? _photoFile;
|
||||
Uint8List? _photoBytes;
|
||||
@@ -118,6 +128,10 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
final nirRaw = nirToRaw(data.nir);
|
||||
_nirController.text = nirRaw.length == 15 ? formatNir(nirRaw) : data.nir;
|
||||
_agrementController.text = data.agrementNumber;
|
||||
_selectedAgreementDate = data.agreementDate;
|
||||
_agreementDateController.text = data.agreementDate != null
|
||||
? DateFormat('dd/MM/yyyy').format(data.agreementDate!)
|
||||
: '';
|
||||
_capacityController.text = data.capacity?.toString() ?? '';
|
||||
_photoPathFramework = data.photoPath;
|
||||
_photoFile = data.photoFile;
|
||||
@@ -125,15 +139,46 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
_photoFilename = data.photoFilename;
|
||||
_photoConsent = data.photoConsent;
|
||||
}
|
||||
|
||||
if (widget.mode == DisplayMode.editable) {
|
||||
_birthCityFocus = FocusNode();
|
||||
_birthCountryFocus = FocusNode();
|
||||
_birthCityFocus!.addListener(_onBirthCityFocusChange);
|
||||
_birthCountryFocus!.addListener(_onBirthCountryFocusChange);
|
||||
}
|
||||
}
|
||||
|
||||
void _onBirthCityFocusChange() {
|
||||
if (_birthCityFocus == null || _birthCityFocus!.hasFocus) return;
|
||||
_applyPlaceNameFormat(_birthCityController);
|
||||
}
|
||||
|
||||
void _onBirthCountryFocusChange() {
|
||||
if (_birthCountryFocus == null || _birthCountryFocus!.hasFocus) return;
|
||||
_applyPlaceNameFormat(_birthCountryController);
|
||||
}
|
||||
|
||||
void _applyPlaceNameFormat(TextEditingController controller) {
|
||||
final formatted = formatPersonNameCase(controller.text);
|
||||
if (formatted == controller.text) return;
|
||||
controller.value = TextEditingValue(
|
||||
text: formatted,
|
||||
selection: TextSelection.collapsed(offset: formatted.length),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_birthCityFocus?.removeListener(_onBirthCityFocusChange);
|
||||
_birthCountryFocus?.removeListener(_onBirthCountryFocusChange);
|
||||
_birthCityFocus?.dispose();
|
||||
_birthCountryFocus?.dispose();
|
||||
_dateOfBirthController.dispose();
|
||||
_birthCityController.dispose();
|
||||
_birthCountryController.dispose();
|
||||
_nirController.dispose();
|
||||
_agrementController.dispose();
|
||||
_agreementDateController.dispose();
|
||||
_capacityController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -154,6 +199,22 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _selectAgreementDate(BuildContext context) async {
|
||||
final DateTime? picked = await showDatePicker(
|
||||
context: context,
|
||||
initialDate: _selectedAgreementDate ?? DateTime.now().subtract(const Duration(days: 365 * 5)),
|
||||
firstDate: DateTime(1970, 1),
|
||||
lastDate: DateTime.now(),
|
||||
locale: const Locale('fr', 'FR'),
|
||||
);
|
||||
if (picked != null) {
|
||||
setState(() {
|
||||
_selectedAgreementDate = picked;
|
||||
_agreementDateController.text = DateFormat('dd/MM/yyyy').format(picked);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _pickPhoto() async {
|
||||
if (widget.onPickPhoto != null) {
|
||||
await widget.onPickPhoto!();
|
||||
@@ -190,7 +251,19 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
void _clearRegistrationPhoto() {
|
||||
setState(() {
|
||||
_photoBytes = null;
|
||||
_photoFile = null;
|
||||
_photoPathFramework = null;
|
||||
_photoFilename = null;
|
||||
_photoConsent = false;
|
||||
});
|
||||
}
|
||||
|
||||
void _submitForm() {
|
||||
_applyPlaceNameFormat(_birthCityController);
|
||||
_applyPlaceNameFormat(_birthCountryController);
|
||||
if (_formKey.currentState!.validate()) {
|
||||
if (_hasRealPhoto && !_photoConsent) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@@ -210,6 +283,7 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
birthCountry: _birthCountryController.text,
|
||||
nir: normalizeNir(_nirController.text),
|
||||
agrementNumber: _agrementController.text,
|
||||
agreementDate: _selectedAgreementDate,
|
||||
capacity: int.tryParse(_capacityController.text),
|
||||
);
|
||||
|
||||
@@ -491,35 +565,24 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
children: [
|
||||
AspectRatio(
|
||||
aspectRatio: 1,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(18),
|
||||
child: _photoBytes != null && _photoBytes!.isNotEmpty
|
||||
? Image.memory(_photoBytes!, fit: BoxFit.cover)
|
||||
: _photoFile != null
|
||||
? Image.file(_photoFile!, fit: BoxFit.cover)
|
||||
: (_photoPathFramework != null &&
|
||||
_photoPathFramework!.startsWith('assets/')
|
||||
? Image.asset(_photoPathFramework!, fit: BoxFit.contain)
|
||||
: Image.asset('assets/images/photo.png', fit: BoxFit.contain)),
|
||||
),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final side = constraints.biggest.shortestSide;
|
||||
return RegistrationPhotoSlot(
|
||||
side: side,
|
||||
imageBytes: _photoBytes,
|
||||
imageFile: _photoFile,
|
||||
imagePathOrAsset: _photoPathFramework,
|
||||
baseShadowColor: Colors.green.shade300,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
AppCustomCheckbox(
|
||||
label: 'J\'accepte l\'utilisation\nde ma photo.',
|
||||
value: _photoConsent,
|
||||
onChanged: (v) {}, // Readonly
|
||||
onChanged: (_) {}, // Readonly
|
||||
checkboxSize: 22.0,
|
||||
fontSize: 14.0,
|
||||
),
|
||||
@@ -534,32 +597,49 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// Ligne 1 : Ville + Pays
|
||||
// Ligne 1 : Date de naissance + Ville
|
||||
Row(
|
||||
children: [
|
||||
Expanded(child: _buildReadonlyField('Ville de naissance', _birthCityController.text)),
|
||||
Expanded(flex: 2, child: _buildReadonlyField('Date de naissance', _dateOfBirthController.text)),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(child: _buildReadonlyField('Pays de naissance', _birthCountryController.text)),
|
||||
Expanded(flex: 3, child: _buildReadonlyField('Ville de naissance', _birthCityController.text)),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Ligne 2 : Date + NIR (NIR prend plus de place si possible ou 50/50)
|
||||
// Ligne 2 : Pays + NIR
|
||||
Row(
|
||||
children: [
|
||||
Expanded(flex: 2, child: _buildReadonlyField('Date de naissance', _dateOfBirthController.text)),
|
||||
Expanded(flex: 2, child: _buildReadonlyField('Pays de naissance', _birthCountryController.text)),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(flex: 3, child: _buildReadonlyField('NIR', _formatNirForDisplay(_nirController.text))),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// Ligne 3 : Agrément + Capacité
|
||||
// Ligne 3 : N° agrément + Date d'obtention
|
||||
Row(
|
||||
children: [
|
||||
Expanded(flex: 3, child: _buildReadonlyField('N° Agrément', _agrementController.text)),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: _buildReadonlyField('N° d\'agrément', _agrementController.text),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(flex: 2, child: _buildReadonlyField('Capacité', _capacityController.text)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: _buildReadonlyField(
|
||||
'Date d\'obtention de l\'agrément',
|
||||
_agreementDateController.text.isNotEmpty ? _agreementDateController.text : '—',
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildReadonlyField('Capacité d\'accueil', _capacityController.text),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -633,22 +713,6 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Ville de naissance',
|
||||
controller: _birthCityController,
|
||||
hint: 'Votre ville de naissance',
|
||||
validator: (v) => v!.isEmpty ? 'Ville requise' : null,
|
||||
),
|
||||
SizedBox(height: verticalSpacing),
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Pays de naissance',
|
||||
controller: _birthCountryController,
|
||||
hint: 'Votre pays de naissance',
|
||||
validator: (v) => v!.isEmpty ? 'Pays requis' : null,
|
||||
),
|
||||
SizedBox(height: verticalSpacing),
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Date de naissance',
|
||||
@@ -659,6 +723,24 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
suffixIcon: Icons.calendar_today,
|
||||
validator: (v) => _selectedDate == null ? 'Date requise' : null,
|
||||
),
|
||||
SizedBox(height: verticalSpacing),
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Ville de naissance',
|
||||
controller: _birthCityController,
|
||||
hint: 'Ex. Ajaccio, Paris, Casablanca…',
|
||||
validator: (v) => v!.isEmpty ? 'Ville requise' : null,
|
||||
focusNode: _birthCityFocus,
|
||||
),
|
||||
SizedBox(height: verticalSpacing),
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Pays de naissance',
|
||||
controller: _birthCountryController,
|
||||
hint: 'Ex. France, Maroc…',
|
||||
validator: (v) => v!.isEmpty ? 'Pays requis' : null,
|
||||
focusNode: _birthCountryFocus,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -674,6 +756,7 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
),
|
||||
SizedBox(height: verticalSpacing),
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildField(
|
||||
@@ -688,20 +771,33 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
Expanded(
|
||||
child: _buildField(
|
||||
config: config,
|
||||
label: 'Capacité d\'accueil',
|
||||
controller: _capacityController,
|
||||
hint: 'Ex: 3',
|
||||
keyboardType: TextInputType.number,
|
||||
validator: (v) {
|
||||
if (v == null || v.isEmpty) return 'Capacité requise';
|
||||
final n = int.tryParse(v);
|
||||
if (n == null || n <= 0) return 'Nombre invalide';
|
||||
return null;
|
||||
},
|
||||
label: 'Date d\'obtention de l\'agrément',
|
||||
controller: _agreementDateController,
|
||||
hint: 'JJ/MM/AAAA',
|
||||
readOnly: true,
|
||||
onTap: () => _selectAgreementDate(context),
|
||||
suffixIcon: Icons.calendar_today,
|
||||
validator: (_) =>
|
||||
_selectedAgreementDate == null ? 'Date d\'obtention requise' : null,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: verticalSpacing),
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Capacité d\'accueil',
|
||||
controller: _capacityController,
|
||||
hint: 'De 1 à 10 enfants',
|
||||
keyboardType: TextInputType.number,
|
||||
validator: (v) {
|
||||
if (v == null || v.isEmpty) return 'Capacité requise';
|
||||
final n = int.tryParse(v);
|
||||
if (n == null || n < 1) return 'Entrez un nombre entre 1 et 10';
|
||||
if (n > 10) return 'Maximum 10 (plafond agrément)';
|
||||
return null;
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -715,24 +811,6 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
_buildPhotoSection(context, config),
|
||||
const SizedBox(height: 20),
|
||||
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Ville de naissance',
|
||||
controller: _birthCityController,
|
||||
hint: 'Votre ville de naissance',
|
||||
validator: (v) => v!.isEmpty ? 'Ville requise' : null,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Pays de naissance',
|
||||
controller: _birthCountryController,
|
||||
hint: 'Votre pays de naissance',
|
||||
validator: (v) => v!.isEmpty ? 'Pays requis' : null,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Date de naissance',
|
||||
@@ -745,6 +823,26 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Ville de naissance',
|
||||
controller: _birthCityController,
|
||||
hint: 'Ex. Ajaccio, Paris, Casablanca…',
|
||||
validator: (v) => v!.isEmpty ? 'Ville requise' : null,
|
||||
focusNode: _birthCityFocus,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Pays de naissance',
|
||||
controller: _birthCountryController,
|
||||
hint: 'Ex. France, Maroc…',
|
||||
validator: (v) => v!.isEmpty ? 'Pays requis' : null,
|
||||
focusNode: _birthCountryFocus,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
NirTextField(
|
||||
controller: _nirController,
|
||||
fieldWidth: double.infinity,
|
||||
@@ -754,25 +852,46 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'N° d\'agrément',
|
||||
controller: _agrementController,
|
||||
hint: 'Votre numéro d\'agrément',
|
||||
validator: (v) => v!.isEmpty ? 'Agrément requis' : null,
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildField(
|
||||
config: config,
|
||||
label: 'N° d\'agrément',
|
||||
controller: _agrementController,
|
||||
hint: 'N° agrément',
|
||||
validator: (v) => v!.isEmpty ? 'Agrément requis' : null,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: _buildField(
|
||||
config: config,
|
||||
label: 'Date d\'obtention de l\'agrément',
|
||||
controller: _agreementDateController,
|
||||
hint: 'JJ/MM/AAAA',
|
||||
readOnly: true,
|
||||
onTap: () => _selectAgreementDate(context),
|
||||
suffixIcon: Icons.calendar_today,
|
||||
validator: (_) =>
|
||||
_selectedAgreementDate == null ? 'Date d\'obtention requise' : null,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
_buildField(
|
||||
config: config,
|
||||
label: 'Capacité d\'accueil',
|
||||
controller: _capacityController,
|
||||
hint: 'Ex: 3',
|
||||
hint: 'De 1 à 10 enfants',
|
||||
keyboardType: TextInputType.number,
|
||||
validator: (v) {
|
||||
if (v == null || v.isEmpty) return 'Capacité requise';
|
||||
final n = int.tryParse(v);
|
||||
if (n == null || n <= 0) return 'Nombre invalide';
|
||||
if (n == null || n < 1) return 'Entrez un nombre entre 1 et 10';
|
||||
if (n > 10) return 'Maximum 10 (plafond agrément)';
|
||||
return null;
|
||||
},
|
||||
),
|
||||
@@ -780,52 +899,33 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
);
|
||||
}
|
||||
|
||||
/// Section photo + checkbox
|
||||
/// Section photo + checkbox (même logique visuelle que les enfants : cadre, croix).
|
||||
Widget _buildPhotoSection(BuildContext context, DisplayConfig config) {
|
||||
final Color baseCardColorForShadow = Colors.green.shade300;
|
||||
final Color initialPhotoShadow = baseCardColorForShadow.withAlpha(90);
|
||||
final Color hoverPhotoShadow = baseCardColorForShadow.withAlpha(130);
|
||||
|
||||
ImageProvider? currentImageProvider;
|
||||
if (_photoBytes != null && _photoBytes!.isNotEmpty) {
|
||||
currentImageProvider = MemoryImage(_photoBytes!);
|
||||
} else if (_photoFile != null) {
|
||||
currentImageProvider = FileImage(_photoFile!);
|
||||
} else if (_photoPathFramework != null && _photoPathFramework!.startsWith('assets/')) {
|
||||
currentImageProvider = AssetImage(_photoPathFramework!);
|
||||
}
|
||||
|
||||
final photoSize = config.isMobile ? 200.0 : 270.0;
|
||||
final scaleFactor = config.isMobile ? 0.9 : 1.1;
|
||||
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
HoverReliefWidget(
|
||||
onPressed: _pickPhoto,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
initialShadowColor: initialPhotoShadow,
|
||||
hoverShadowColor: hoverPhotoShadow,
|
||||
child: SizedBox(
|
||||
height: photoSize,
|
||||
width: photoSize,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
image: currentImageProvider != null
|
||||
? DecorationImage(image: currentImageProvider, fit: BoxFit.cover)
|
||||
: null,
|
||||
),
|
||||
child: currentImageProvider == null
|
||||
? Image.asset('assets/images/photo.png', fit: BoxFit.contain)
|
||||
: null,
|
||||
),
|
||||
),
|
||||
RegistrationPhotoSlot(
|
||||
side: photoSize,
|
||||
scaleFactor: scaleFactor,
|
||||
imageBytes: _photoBytes,
|
||||
imageFile: _photoFile,
|
||||
imagePathOrAsset: _photoPathFramework,
|
||||
onTapPick: config.isReadonly ? null : _pickPhoto,
|
||||
onClear: config.isReadonly ? null : _clearRegistrationPhoto,
|
||||
baseShadowColor: Colors.green.shade300,
|
||||
isMobile: config.isMobile,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
AppCustomCheckbox(
|
||||
label: 'J\'accepte l\'utilisation\nde ma photo.',
|
||||
value: _photoConsent,
|
||||
onChanged: (val) => setState(() => _photoConsent = val == true),
|
||||
onChanged: (val) {
|
||||
if (config.isReadonly) return;
|
||||
setState(() => _photoConsent = val == true);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -843,6 +943,7 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
IconData? suffixIcon,
|
||||
String? Function(String?)? validator,
|
||||
List<TextInputFormatter>? inputFormatters,
|
||||
FocusNode? focusNode,
|
||||
}) {
|
||||
if (config.isReadonly) {
|
||||
return FormFieldWrapper(
|
||||
@@ -853,6 +954,7 @@ class _ProfessionalInfoFormScreenState extends State<ProfessionalInfoFormScreen>
|
||||
} else {
|
||||
return CustomAppTextField(
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
labelText: label,
|
||||
hintText: hint ?? label,
|
||||
fieldWidth: double.infinity,
|
||||
|
||||
Reference in New Issue
Block a user