2024-04-29 14:36:25 +02:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class MyTextField extends StatelessWidget {
|
|
|
|
final String hintText;
|
2024-04-30 19:25:16 +02:00
|
|
|
final bool obscureText;
|
2024-04-29 14:36:25 +02:00
|
|
|
final TextEditingController controller;
|
2024-04-30 19:25:16 +02:00
|
|
|
final FocusNode? focusNode;
|
2024-04-29 14:36:25 +02:00
|
|
|
|
|
|
|
const MyTextField({
|
|
|
|
super.key,
|
|
|
|
required this.hintText,
|
2024-04-30 19:25:16 +02:00
|
|
|
required this.obscureText,
|
2024-04-29 14:36:25 +02:00
|
|
|
required this.controller,
|
2024-04-30 19:25:16 +02:00
|
|
|
this.focusNode,
|
2024-04-29 14:36:25 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Padding(
|
2024-04-30 22:33:01 +02:00
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 25.0, vertical: 15),
|
2024-04-29 14:36:25 +02:00
|
|
|
child: TextField(
|
2024-04-30 19:25:16 +02:00
|
|
|
obscureText: obscureText,
|
2024-04-29 14:36:25 +02:00
|
|
|
controller: controller,
|
2024-04-30 19:25:16 +02:00
|
|
|
focusNode: focusNode,
|
2024-04-29 14:36:25 +02:00
|
|
|
decoration: InputDecoration(
|
|
|
|
enabledBorder: OutlineInputBorder(
|
|
|
|
borderSide:
|
|
|
|
BorderSide(color: Theme.of(context).colorScheme.tertiary),
|
|
|
|
),
|
|
|
|
focusedBorder: OutlineInputBorder(
|
|
|
|
borderSide:
|
|
|
|
BorderSide(color: Theme.of(context).colorScheme.primary),
|
|
|
|
),
|
|
|
|
fillColor: Theme.of(context).colorScheme.secondary,
|
|
|
|
filled: true,
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: Theme.of(context).colorScheme.primary,
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|