Files
CityCards_Customer_Flutter/lib/common_packages/custom_search_field.dart
2025-10-27 15:27:21 +05:30

42 lines
1.2 KiB
Dart

import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
class CommonSearchField extends StatelessWidget {
final ValueChanged<String> onChanged;
final String hint;
final bool showSuffix;
final Color hintColor;
const CommonSearchField({
super.key,
required this.onChanged,
this.hint = "Search attractions",
this.showSuffix = false,
required this.hintColor
});
@override
Widget build(BuildContext context) {
return TextField(
onChanged: onChanged,
decoration: InputDecoration(
hintText: hint,
hintStyle: GoogleFonts.poppins(color: hintColor),
filled: true,
fillColor: Colors.white,
suffixIcon: showSuffix ? Image.asset("assets/icons/search.png",scale: 4,) : null,
contentPadding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xffF95F62).withOpacity(0.4)),
borderRadius: BorderRadius.circular(12),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xffF95F62).withOpacity(0.4)),
borderRadius: BorderRadius.circular(12),
),
),
);
}
}