mobile-app/lib/utils/custom_formfield.dart

43 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
class CustomTextField extends StatelessWidget {
final TextEditingController controller;
final String labelText;
final TextInputType keyboardType;
final bool obscureText;
const CustomTextField({
super.key,
required this.controller,
required this.labelText,
this.keyboardType = TextInputType.text,
this.obscureText = false,
});
@override
Widget build(BuildContext context) {
return TextFormField(
controller: controller,
keyboardType: keyboardType,
obscureText: obscureText,
decoration: InputDecoration(
labelText: labelText,
labelStyle: const TextStyle(
color: Color.fromARGB(255, 102, 101, 101),
),
enabledBorder: const OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Color.fromARGB(57, 69, 69, 219)),
),
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(10.0),
borderSide: BorderSide(
strokeAlign: .5,
color: const Color(0xFF4545DB).withOpacity(0.5),
),
),
),
);
}
}