Files
mih-project/Frontend/patient_manager/lib/components/myTextInput.dart

52 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
class MyTextField extends StatelessWidget {
final controller;
final String hintText;
final bool editable;
const MyTextField({
super.key,
required this.controller,
required this.hintText,
required this.editable,
});
bool makeEditable() {
if (editable) {
return false;
} else {
return true;
}
}
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 25.0),
child: TextField(
controller: controller,
readOnly: makeEditable(),
obscureText: false,
decoration: InputDecoration(
label: Text(hintText),
labelStyle: const TextStyle(color: Colors.blueAccent),
fillColor: Colors.white,
filled: true,
//hintText: hintText,
//hintStyle: TextStyle(color: Colors.blueGrey[400]),
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(
color: Colors.blueAccent,
width: 2.0,
),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(color: Colors.blue),
),
),
),
);
}
}