2025-07-10 18:52:04 -05:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-01-08 13:44:39 -06:00
|
|
|
class BlindMasterMainInput extends StatefulWidget {
|
2025-07-10 18:52:04 -05:00
|
|
|
const BlindMasterMainInput(this.label, {super.key, this.controller, this.validator, this.color, this.password = false});
|
|
|
|
|
|
|
|
|
|
final String label;
|
|
|
|
|
final TextEditingController? controller;
|
|
|
|
|
final Color? color;
|
|
|
|
|
final bool password;
|
|
|
|
|
|
|
|
|
|
final String? Function(String?)? validator;
|
|
|
|
|
|
2026-01-08 13:44:39 -06:00
|
|
|
@override
|
|
|
|
|
State<BlindMasterMainInput> createState() => _BlindMasterMainInputState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _BlindMasterMainInputState extends State<BlindMasterMainInput> {
|
|
|
|
|
bool _obscureText = true;
|
|
|
|
|
|
2025-07-10 18:52:04 -05:00
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: EdgeInsets.all(10),
|
|
|
|
|
child:TextFormField(
|
2026-01-08 13:44:39 -06:00
|
|
|
validator: widget.validator,
|
|
|
|
|
obscureText: widget.password && _obscureText,
|
2025-07-10 18:52:04 -05:00
|
|
|
enableSuggestions: false,
|
|
|
|
|
autocorrect: false,
|
2026-01-08 13:44:39 -06:00
|
|
|
controller: widget.controller,
|
2025-07-10 18:52:04 -05:00
|
|
|
style: TextStyle(
|
2026-01-08 13:44:39 -06:00
|
|
|
color: widget.color
|
2025-07-10 18:52:04 -05:00
|
|
|
),
|
|
|
|
|
decoration: InputDecoration(
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(10)),
|
|
|
|
|
),
|
2026-01-08 13:44:39 -06:00
|
|
|
labelText: widget.label,
|
|
|
|
|
labelStyle: TextStyle(color: widget.color),
|
2025-07-10 18:52:04 -05:00
|
|
|
contentPadding: EdgeInsets.all(10),
|
2026-01-08 13:44:39 -06:00
|
|
|
suffixIcon: widget.password
|
|
|
|
|
? IconButton(
|
|
|
|
|
icon: Icon(
|
|
|
|
|
_obscureText ? Icons.visibility : Icons.visibility_off,
|
|
|
|
|
),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
setState(() {
|
|
|
|
|
_obscureText = !_obscureText;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
: null,
|
2025-07-10 18:52:04 -05:00
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|