47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class RoundedInput extends StatelessWidget {
|
|
final TextEditingController controller;
|
|
final String hint;
|
|
final TextInputType keyboardType;
|
|
final bool obscure;
|
|
final int? maxLines;
|
|
|
|
const RoundedInput({
|
|
super.key,
|
|
required this.controller,
|
|
required this.hint,
|
|
this.keyboardType = TextInputType.text,
|
|
this.obscure = false,
|
|
this.maxLines = 1,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final radius = BorderRadius.circular(12);
|
|
|
|
return TextField(
|
|
controller: controller,
|
|
keyboardType: keyboardType,
|
|
obscureText: obscure,
|
|
maxLines: obscure ? 1 : maxLines,
|
|
style: const TextStyle(
|
|
color: Colors.grey, // grey input text
|
|
),
|
|
decoration: InputDecoration(
|
|
filled: true,
|
|
fillColor: const Color(0xFFD8E7FF), // light blue background
|
|
hintText: hint,
|
|
hintStyle: const TextStyle(
|
|
color: Colors.grey, // grey hint text
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
|
border: OutlineInputBorder(
|
|
borderRadius: radius,
|
|
borderSide: BorderSide.none,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|