refactor of usecases

This commit is contained in:
2026-02-23 17:18:50 +05:30
parent 56666ece30
commit 13f8003bda
37 changed files with 1563 additions and 105 deletions

View File

@@ -27,6 +27,7 @@ class UiTextField extends StatelessWidget {
this.suffix,
this.readOnly = false,
this.onTap,
this.validator,
});
/// The label text to display above the text field.
final String? label;
@@ -76,6 +77,9 @@ class UiTextField extends StatelessWidget {
/// Callback when the text field is tapped.
final VoidCallback? onTap;
/// Optional validator for the text field.
final String? Function(String?)? validator;
@override
Widget build(BuildContext context) {
return Column(
@@ -86,18 +90,19 @@ class UiTextField extends StatelessWidget {
Text(label!, style: UiTypography.body4m.textSecondary),
const SizedBox(height: UiConstants.space1),
],
TextField(
TextFormField(
controller: controller,
onChanged: onChanged,
keyboardType: keyboardType,
maxLines: maxLines,
obscureText: obscureText,
textInputAction: textInputAction,
onSubmitted: onSubmitted,
onFieldSubmitted: onSubmitted,
autofocus: autofocus,
inputFormatters: inputFormatters,
readOnly: readOnly,
onTap: onTap,
validator: validator,
style: UiTypography.body1r.textPrimary,
decoration: InputDecoration(
hintText: hintText,