fix(#131): polish fiche AM — champs pro, places, vigilance et photo.
Fiche pro entièrement éditable, places déclarées en lecture seule avec alerte rouge, icône vigilance sur la liste AM, et cadrage photo aligné sur le wizard validation. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -210,6 +210,28 @@ class ValidationEditableField extends StatelessWidget {
|
||||
|
||||
static const double _compactFieldHeight = 34;
|
||||
|
||||
static BoxDecoration _compactDecoration({bool error = false}) {
|
||||
return BoxDecoration(
|
||||
color: error ? Colors.red.shade50 : Colors.grey.shade50,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(
|
||||
color: error ? Colors.red.shade400 : Colors.grey.shade300,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
static InputDecoration _compactInputDecoration({String? hint}) {
|
||||
return InputDecoration(
|
||||
isDense: true,
|
||||
filled: false,
|
||||
hintText: hint,
|
||||
border: InputBorder.none,
|
||||
enabledBorder: InputBorder.none,
|
||||
focusedBorder: InputBorder.none,
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 9),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!compact || maxLines > 1) {
|
||||
@@ -230,17 +252,19 @@ class ValidationEditableField extends StatelessWidget {
|
||||
}
|
||||
return SizedBox(
|
||||
height: _compactFieldHeight,
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
keyboardType: keyboardType,
|
||||
inputFormatters: inputFormatters,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(color: Colors.black87, fontSize: 13, height: 1.15),
|
||||
decoration: ValidationFieldDecoration.input(
|
||||
hint: hintText,
|
||||
compact: true,
|
||||
).copyWith(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 10, vertical: 9),
|
||||
child: DecoratedBox(
|
||||
decoration: _compactDecoration(),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
keyboardType: keyboardType,
|
||||
inputFormatters: inputFormatters,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
fontSize: 13,
|
||||
height: 1.15,
|
||||
),
|
||||
decoration: _compactInputDecoration(hint: hintText),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -278,12 +302,14 @@ class ValidationReadOnlyField extends StatelessWidget {
|
||||
final String value;
|
||||
final int? maxLines;
|
||||
final bool compact;
|
||||
final bool error;
|
||||
|
||||
const ValidationReadOnlyField({
|
||||
super.key,
|
||||
required this.value,
|
||||
this.maxLines = 1,
|
||||
this.compact = false,
|
||||
this.error = false,
|
||||
});
|
||||
|
||||
static const double _compactFieldHeight = 34;
|
||||
@@ -298,13 +324,20 @@ class ValidationReadOnlyField extends StatelessWidget {
|
||||
horizontal: compact ? 10 : 12,
|
||||
vertical: compact ? 7 : 10,
|
||||
),
|
||||
decoration: ValidationFieldDecoration.container(),
|
||||
decoration: error
|
||||
? BoxDecoration(
|
||||
color: Colors.red.shade50,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: Colors.red.shade400),
|
||||
)
|
||||
: ValidationFieldDecoration.container(),
|
||||
child: Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
color: Colors.black87,
|
||||
color: error ? Colors.red.shade800 : Colors.black87,
|
||||
fontSize: compact ? 13 : 14,
|
||||
height: compact ? 1.2 : null,
|
||||
fontWeight: error ? FontWeight.w600 : null,
|
||||
),
|
||||
maxLines: maxLines,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
||||
Reference in New Issue
Block a user