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.
46 lines
1.1 KiB
46 lines
1.1 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; |
|
|
|
const FxTextField({ |
|
Key? key, |
|
this.ctrl, |
|
this.fc, |
|
required this.label, |
|
required this.hint, |
|
this.errorMessage, |
|
this.isReadOnly, |
|
this.isEnabled, |
|
this.suffixText, |
|
}) : super(key: key); |
|
|
|
@override |
|
Widget build(BuildContext context) { |
|
return TextField( |
|
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, |
|
); |
|
} |
|
}
|
|
|