File tree Expand file tree Collapse file tree 3 files changed +19
-14
lines changed
presentation/widgets/filter
packages/flowy_infra_ui/lib/style_widget Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ class GridCreateFilterBloc
6262 final List <FieldInfo > allFields = List .from (fields);
6363 final keyword = filterText.toLowerCase ();
6464 allFields.retainWhere ((field) {
65- if (field.canCreateFilter) {
65+ if (! field.canCreateFilter) {
6666 return false ;
6767 }
6868
Original file line number Diff line number Diff line change @@ -54,21 +54,26 @@ class GridFilterMenu extends StatelessWidget {
5454 }
5555
5656 Widget buildFilterItems (String viewId, GridFilterMenuState state) {
57- final List <Widget > children = state.filters
58- .map ((filterInfo) => FilterMenuItem (filterInfo: filterInfo))
59- .toList ();
57+ final List <Widget > children = [];
58+ children.addAll (
59+ state.filters
60+ .map ((filterInfo) => FilterMenuItem (filterInfo: filterInfo))
61+ .toList (),
62+ );
63+
64+ if (state.creatableFields.isNotEmpty) {
65+ children.add (AddFilterButton (viewId: viewId));
66+ }
67+
6068 return Row (
6169 children: [
62- SingleChildScrollView (
63- controller: ScrollController (),
64- scrollDirection: Axis .horizontal,
70+ Expanded (
6571 child: Wrap (
66- spacing: 4 ,
72+ spacing: 6 ,
73+ runSpacing: 4 ,
6774 children: children,
6875 ),
6976 ),
70- const HSpace (4 ),
71- if (state.creatableFields.isNotEmpty) AddFilterButton (viewId: viewId),
7277 ],
7378 );
7479 }
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ class FlowyButton extends StatelessWidget {
2424 required this .text,
2525 this .onTap,
2626 this .onHover,
27- this .margin = const EdgeInsets .symmetric (horizontal: 6 , vertical: 2 ),
27+ this .margin = const EdgeInsets .symmetric (horizontal: 10 , vertical: 2 ),
2828 this .leftIcon,
2929 this .rightIcon,
3030 this .hoverColor,
@@ -63,9 +63,9 @@ class FlowyButton extends StatelessWidget {
6363 children.add (Expanded (child: text));
6464
6565 if (rightIcon != null ) {
66- children.add (const HSpace (6 ));
67- children. add (
68- SizedBox . fromSize (size : const Size . square ( 16 ), child : rightIcon! ) );
66+ children.add (const HSpace (10 ));
67+ // No need to define the size of rightIcon. Just use its intrinsic width
68+ children. add ( rightIcon! );
6969 }
7070
7171 Widget child = Row (
You can’t perform that action at this time.
0 commit comments