Files
kent_logistics_app/lib/widgets/rounded_input.dart

47 lines
1.2 KiB
Dart
Raw Normal View History

2025-11-28 10:14:30 +05:30
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);
2025-12-11 18:36:11 +05:30
2025-11-28 10:14:30 +05:30
return TextField(
controller: controller,
keyboardType: keyboardType,
obscureText: obscure,
2025-12-11 18:36:11 +05:30
maxLines: obscure ? 1 : maxLines,
style: const TextStyle(
color: Colors.grey, // grey input text
),
2025-11-28 10:14:30 +05:30
decoration: InputDecoration(
filled: true,
2025-12-11 18:36:11 +05:30
fillColor: const Color(0xFFD8E7FF), // light blue background
2025-11-28 10:14:30 +05:30
hintText: hint,
2025-12-11 18:36:11 +05:30
hintStyle: const TextStyle(
color: Colors.grey, // grey hint text
),
2025-11-28 10:14:30 +05:30
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
2025-12-11 18:36:11 +05:30
border: OutlineInputBorder(
borderRadius: radius,
borderSide: BorderSide.none,
),
2025-11-28 10:14:30 +05:30
),
);
}
}