You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
import 'package:flutter/material.dart'; |
|
|
|
class FxTextField extends StatelessWidget { |
|
final TextEditingController? ctrl; |
|
final FocusNode? fc; |
|
final String label; |
|
final String hint; |
|
final String? errorMessage; |
|
final bool? isReadOnly; |
|
final bool? isEnabled; |
|
final String? suffixText; |
|
final bool obscureText; |
|
const FxTextField({ |
|
Key? key, |
|
this.ctrl, |
|
this.fc, |
|
required this.label, |
|
required this.hint, |
|
this.errorMessage, |
|
this.isReadOnly, |
|
this.isEnabled, |
|
this.suffixText, |
|
this.obscureText = false, |
|
}) : super(key: key); |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
return TextField( |
|
obscureText: obscureText, |
|
decoration: InputDecoration( |
|
border: OutlineInputBorder( |
|
borderRadius: BorderRadius.circular(10), |
|
), |
|
hintText: hint, |
|
labelText: label, |
|
errorText: errorMessage, |
|
suffixIcon: Padding( |
|
padding: const EdgeInsets.only(right: 10.0, top: 10.0), |
|
child: Text(suffixText ?? ""), |
|
), |
|
), |
|
controller: ctrl, |
|
focusNode: fc, |
|
readOnly: isReadOnly ?? false, |
|
enabled: isEnabled ?? true, |
|
); |
|
} |
|
}
|
|
|