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, ); } }