40 lines
1.1 KiB
Dart
40 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:konectar_events/utils/util.dart';
|
|
|
|
class CustomTextField extends StatelessWidget {
|
|
String labelText;
|
|
TextEditingController controller;
|
|
String? hintText;
|
|
IconButton? suffixIcon;
|
|
bool? enabled = true;
|
|
bool? obscure = false;
|
|
CustomTextField(
|
|
{super.key,
|
|
required this.controller,
|
|
this.hintText,
|
|
required this.labelText,
|
|
this.suffixIcon,
|
|
this.enabled,
|
|
this.obscure});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SizedBox(
|
|
height: 50,
|
|
child: TextField(
|
|
controller: controller,
|
|
style: TextStyle(fontSize: isTablet ? 18.0 : 16),
|
|
enabled: enabled,
|
|
obscureText: obscure ?? false,
|
|
decoration: InputDecoration(
|
|
border: const OutlineInputBorder(),
|
|
labelStyle: TextStyle(fontSize: isTablet ? 18.0 : 16),
|
|
labelText: labelText,
|
|
hintStyle: TextStyle(fontSize: isTablet ? 18.0 : 16),
|
|
suffixIcon: suffixIcon,
|
|
hintText: hintText),
|
|
),
|
|
);
|
|
}
|
|
}
|