Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…menu into vincent7293-master

# Conflicts:
#	lib/src/gzx_dropdown_header.dart
  • Loading branch information
GanZhiXiong committed Apr 7, 2021
2 parents d9bf238 + 0a6b5cb commit 7b8b357
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ A custom is strong dropdown menu for Flutter. Easy to use and powerful for custo
// 下拉的头部项,目前每一项,只能自定义显示的文字、图标、图标大小修改
items: [
GZXDropDownHeaderItem(_dropDownHeaderItemStrings[0]),
GZXDropDownHeaderItem(_dropDownHeaderItemStrings[1]),
GZXDropDownHeaderItem(_dropDownHeaderItemStrings[1], iconData: Icons.keyboard_arrow_down, iconDropDownData: Icons.keyboard_arrow_up),
GZXDropDownHeaderItem(_dropDownHeaderItemStrings[2], style: TextStyle(color: Colors.green)),
GZXDropDownHeaderItem(_dropDownHeaderItemStrings[3], iconData: Icons.filter_frames, iconSize: 18),
],
Expand Down
8 changes: 7 additions & 1 deletion example/lib/gzx_dropdown_menu_test_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,16 @@ class _GZXDropDownMenuTestPageState extends State<GZXDropDownMenuTestPage> {
// 下拉的头部项,目前每一项,只能自定义显示的文字、图标、图标大小修改
items: [
GZXDropDownHeaderItem(_dropDownHeaderItemStrings[0]),
GZXDropDownHeaderItem(_dropDownHeaderItemStrings[1]),
GZXDropDownHeaderItem(
_dropDownHeaderItemStrings[1],
iconData: Icons.keyboard_arrow_down,
iconDropDownData: Icons.keyboard_arrow_up,
),
GZXDropDownHeaderItem(
_dropDownHeaderItemStrings[2],
style: TextStyle(color: Colors.green),
iconData: Icons.arrow_upward,
iconDropDownData: Icons.arrow_downward,
),
GZXDropDownHeaderItem(
_dropDownHeaderItemStrings[3],
Expand Down
8 changes: 6 additions & 2 deletions lib/src/gzx_dropdown_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ class _GZXDropDownHeaderState extends State<GZXDropDownHeader>
Icon(
!_isShowDropDownItemWidget
? item.iconData ?? Icons.arrow_drop_down
: item.iconData ?? Icons.arrow_drop_up,
: item.iconDropDownData ??
item.iconData ??
Icons.arrow_drop_up,
color: _isShowDropDownItemWidget
? _iconDropDownColor
: item.style?.color ?? widget.iconColor,
Expand All @@ -192,7 +194,7 @@ class _GZXDropDownHeaderState extends State<GZXDropDownHeader>
right: BorderSide(color: widget.dividerColor, width: 1),
),
),
)
),
],
),
),
Expand All @@ -203,12 +205,14 @@ class _GZXDropDownHeaderState extends State<GZXDropDownHeader>
class GZXDropDownHeaderItem {
final String title;
final IconData? iconData;
final IconData? iconDropDownData;
final double? iconSize;
final TextStyle? style;

GZXDropDownHeaderItem(
this.title, {
this.iconData,
this.iconDropDownData,
this.iconSize,
this.style,
});
Expand Down

0 comments on commit 7b8b357

Please sign in to comment.