47 lines
1.4 KiB
Dart
47 lines
1.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:gap/gap.dart';
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
class InputWidget extends StatelessWidget {
|
|
final String label;
|
|
final TextEditingController controller;
|
|
final String placeholder;
|
|
|
|
const InputWidget({
|
|
super.key,
|
|
required this.label,
|
|
required this.controller,
|
|
required this.placeholder,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
if (label.isNotEmpty)
|
|
Text('$label:',
|
|
style: GoogleFonts.inter(
|
|
textStyle:
|
|
const TextStyle(color: Color.fromRGBO(255, 255, 255, 1), fontSize: 12, fontWeight: FontWeight.w500),
|
|
)),
|
|
const Gap(8),
|
|
TextField(
|
|
controller: controller,
|
|
decoration: InputDecoration(
|
|
filled: true,
|
|
fillColor: const Color.fromRGBO(255, 255, 255, 1),
|
|
border: OutlineInputBorder(borderRadius: BorderRadius.circular(4)),
|
|
contentPadding: const EdgeInsets.symmetric(vertical: 0, horizontal: 14),
|
|
prefixIcon: Icon(Icons.search, color: Colors.grey),
|
|
hintText: placeholder),
|
|
style: GoogleFonts.inter(
|
|
textStyle: const TextStyle(
|
|
color: Color.fromRGBO(0, 0, 0, 1),
|
|
fontSize: 16,
|
|
)),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|