11import 'package:flutter/material.dart' ;
2+ import 'package:monet/core/constants/palette.dart' ;
23
34/// A helper class that provides a consistent input decoration style for form fields.
45/// Each input field will have a rounded border, a specific fill color, and a prefix icon.
@@ -19,33 +20,38 @@ import 'package:flutter/material.dart';
1920class InputStyle {
2021 InputDecoration input (String label, IconData icon) {
2122 return InputDecoration (
23+ contentPadding: const EdgeInsets .symmetric (horizontal: 16 , vertical: 18 ),
24+ fillColor: Colors .white.withValues (alpha: 0.92 ),
25+ filled: true ,
26+ floatingLabelStyle: const TextStyle (color: Palette .primary, fontSize: 12 , fontWeight: FontWeight .w600),
27+ hintStyle: const TextStyle (color: Palette .textMuted, fontSize: 12 ),
28+ labelStyle: const TextStyle (color: Palette .textSecondary, fontSize: 12 , fontWeight: FontWeight .w400),
29+ labelText: label,
30+ prefixIcon: Padding (
31+ padding: const EdgeInsets .only (left: 16 , right: 12 ),
32+ child: Icon (icon, color: Palette .textSecondary, size: 20 ),
33+ ),
34+ prefixIconConstraints: const BoxConstraints (minHeight: 48 , minWidth: 48 ),
2235 border: OutlineInputBorder (
23- borderRadius: BorderRadius .circular (12 ),
24- borderSide: BorderSide .none ,
36+ borderRadius: BorderRadius .circular (16 ),
37+ borderSide: const BorderSide (color : Palette .border, width : 1.2 ) ,
2538 ),
26- contentPadding: const EdgeInsets .symmetric (vertical: 18 , horizontal: 12 ),
2739 enabledBorder: OutlineInputBorder (
28- borderRadius: BorderRadius .circular (12 ),
29- borderSide: BorderSide (color: Colors .grey.shade300),
30- ),
31- errorBorder: OutlineInputBorder (
32- borderRadius: BorderRadius .circular (12 ),
33- borderSide: const BorderSide (color: Colors .redAccent, width: 1.5 ),
40+ borderRadius: BorderRadius .circular (16 ),
41+ borderSide: const BorderSide (color: Palette .border, width: 1.2 ),
3442 ),
35- fillColor: const Color (0xFFF5F4EF ),
36- filled: true ,
3743 focusedBorder: OutlineInputBorder (
38- borderRadius: BorderRadius .circular (12 ),
39- borderSide: const BorderSide (color: Color ( 0xFF232320 ) , width: 1.5 ),
44+ borderRadius: BorderRadius .circular (16 ),
45+ borderSide: const BorderSide (color: Palette .primary , width: 1.8 ),
4046 ),
41- hintStyle: const TextStyle (fontSize: 12.0 ),
42- labelStyle: TextStyle (color: Colors .grey.shade600, fontSize: 12 ),
43- labelText: label,
44- prefixIcon: Padding (
45- padding: const EdgeInsets .only (left: 12 , right: 6 ),
46- child: Icon (icon, color: const Color (0xFF232320 ), size: 20 ),
47+ errorBorder: OutlineInputBorder (
48+ borderRadius: BorderRadius .circular (16 ),
49+ borderSide: const BorderSide (color: Palette .danger, width: 1.5 ),
50+ ),
51+ focusedErrorBorder: OutlineInputBorder (
52+ borderRadius: BorderRadius .circular (16 ),
53+ borderSide: const BorderSide (color: Palette .danger, width: 1.8 ),
4754 ),
48- prefixIconConstraints: const BoxConstraints (minHeight: 40 , minWidth: 40 ),
4955 );
5056 }
5157}
0 commit comments