37 lines
963 B
Dart
37 lines
963 B
Dart
import 'package:flutter/material.dart';
|
|
import '../utils/colors.dart';
|
|
|
|
class CustomTextField extends StatelessWidget {
|
|
final String label;
|
|
final TextEditingController controller;
|
|
final bool obscure;
|
|
|
|
const CustomTextField({
|
|
super.key,
|
|
required this.label,
|
|
required this.controller,
|
|
this.obscure = false,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Semantics(
|
|
label: "Input $label",
|
|
child: TextField(
|
|
controller: controller,
|
|
obscureText: obscure,
|
|
style: TextStyle(color: AppColors.text),
|
|
decoration: InputDecoration(
|
|
labelText: label,
|
|
labelStyle: TextStyle(color: AppColors.text),
|
|
enabledBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(color: AppColors.text),
|
|
),
|
|
focusedBorder: OutlineInputBorder(
|
|
borderSide: BorderSide(color: AppColors.primary),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |