mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
71 lines
2.0 KiB
Dart
71 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_svg/svg.dart';
|
|
import 'package:syncrow_web/utils/color_manager.dart';
|
|
import 'package:syncrow_web/utils/constants/assets.dart';
|
|
|
|
class CustomSearchBar extends StatelessWidget {
|
|
final TextEditingController? controller;
|
|
final String hintText;
|
|
|
|
const CustomSearchBar({
|
|
Key? key,
|
|
this.controller,
|
|
this.hintText = 'Search',
|
|
}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
decoration: BoxDecoration(
|
|
color: ColorsManager.whiteColors,
|
|
boxShadow: [
|
|
BoxShadow(
|
|
color: Colors.black.withOpacity(0.2),
|
|
spreadRadius: 0,
|
|
blurRadius: 8,
|
|
offset: const Offset(0, 4),
|
|
),
|
|
],
|
|
),
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
child: Container(
|
|
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
|
width: double.infinity,
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
child: TextField(
|
|
controller: controller,
|
|
style: const TextStyle(
|
|
color: Colors.black,
|
|
),
|
|
decoration: InputDecoration(
|
|
filled: true,
|
|
fillColor: ColorsManager.textFieldGreyColor,
|
|
hintText: hintText,
|
|
hintStyle: TextStyle(
|
|
color: Colors.grey[400],
|
|
),
|
|
suffixIcon: Padding(
|
|
padding: const EdgeInsets.only(right: 16),
|
|
child: SvgPicture.asset(
|
|
Assets.textFieldSearch,
|
|
width: 24,
|
|
height: 24,
|
|
),
|
|
),
|
|
border: OutlineInputBorder(
|
|
borderSide: BorderSide.none,
|
|
borderRadius: BorderRadius.circular(12),
|
|
),
|
|
contentPadding: const EdgeInsets.symmetric(
|
|
vertical: 14,
|
|
horizontal: 16,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|