mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 15:30:59 +00:00
34 lines
876 B
Dart
34 lines
876 B
Dart
|
import 'package:flutter/material.dart';
|
||
|
|
||
|
class LightmeterTextField extends TextFormField {
|
||
|
LightmeterTextField({
|
||
|
super.controller,
|
||
|
super.autofocus,
|
||
|
super.initialValue,
|
||
|
super.inputFormatters,
|
||
|
super.maxLength,
|
||
|
super.onChanged,
|
||
|
super.style,
|
||
|
super.textAlign,
|
||
|
Widget? leading,
|
||
|
String? hintText,
|
||
|
}) : super(
|
||
|
autovalidateMode: AutovalidateMode.onUserInteraction,
|
||
|
maxLines: 1,
|
||
|
decoration: InputDecoration(
|
||
|
counter: const SizedBox(),
|
||
|
contentPadding: EdgeInsets.zero,
|
||
|
errorStyle: const TextStyle(fontSize: 0),
|
||
|
icon: leading,
|
||
|
hintText: hintText,
|
||
|
),
|
||
|
validator: (value) {
|
||
|
if (value == null || value.isEmpty) {
|
||
|
return '';
|
||
|
} else {
|
||
|
return null;
|
||
|
}
|
||
|
},
|
||
|
);
|
||
|
}
|