diff --git a/lib/widgets/search_field.dart b/lib/widgets/search_field.dart index 006bc3c..20c0436 100644 --- a/lib/widgets/search_field.dart +++ b/lib/widgets/search_field.dart @@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; class SearchField extends StatefulWidget { final String title; + final bool? isFiltered; final void Function(String value) onChanged; final VoidCallback? onFilterButtonPressed; @@ -13,6 +14,7 @@ class SearchField extends StatefulWidget { required this.title, required this.onChanged, this.onFilterButtonPressed, + this.isFiltered, }) : super(key: key); @override @@ -78,18 +80,36 @@ class _SearchFieldState extends State { border: InputBorder.none, hintText: 'جستجو مطلب در ${widget.title}', hintStyle: TextStyle( - color: Theme.of(context).colorScheme.disabledText), + color: Theme.of(context).colorScheme.disabledText, + ), ), ), ), ), if (widget.onFilterButtonPressed != null) const SizedBox(width: 8), if (widget.onFilterButtonPressed != null) - DidvanIconButton( - onPressed: widget.onFilterButtonPressed!, - icon: DidvanIcons.filter_regular, - size: 32, - gestureSize: 32, + Stack( + children: [ + DidvanIconButton( + onPressed: widget.onFilterButtonPressed!, + icon: widget.isFiltered! + ? DidvanIcons.filter_solid + : DidvanIcons.filter_regular, + size: 32, + gestureSize: 32, + ), + if (widget.isFiltered!) + Positioned( + child: Container( + width: 10, + height: 10, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).colorScheme.secondary, + ), + ), + ), + ], ), ], ),