Skip to content

Commit 2090c8d

Browse files
Version 2.1.3 #536 (#538)
* fix #536 * bump version to 2.1.3 * add changelog entry for version 2.1.3
1 parent b8a8e3d commit 2090c8d

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [2.1.3]
2+
### 🛠️ Fixed 🛠️
3+
* Fix `ToolbarOverflowButton` only reacting to every second click.
4+
15
## [2.1.2]
26
### 🛠️ Updated 🛠️
37
* Add “Older macOS versions” section to README

lib/src/buttons/toolbar/toolbar_overflow_button.dart

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import 'package:macos_ui/macos_ui.dart';
22
import 'package:macos_ui/src/library.dart';
33

44
/// A button to show at the far right side of the toolbar.
5-
class ToolbarOverflowButton extends StatelessWidget {
5+
class ToolbarOverflowButton extends StatefulWidget {
66
/// Builds a button to show at the far right side of the toolbar, when the
77
/// toolbar actions are overflowing the available horizontal space.
88
///
@@ -20,12 +20,24 @@ class ToolbarOverflowButton extends StatelessWidget {
2020
/// Whether the icon button should be smaller in size (half the toolbar height).
2121
final bool isDense;
2222

23+
@override
24+
State<ToolbarOverflowButton> createState() => _ToolbarOverflowButtonState();
25+
}
26+
27+
class _ToolbarOverflowButtonState extends State<ToolbarOverflowButton> {
28+
late final GlobalKey<ToolbarPopupState> popupKey;
29+
30+
@override
31+
void initState() {
32+
super.initState();
33+
popupKey = GlobalKey<ToolbarPopupState>();
34+
}
35+
2336
@override
2437
Widget build(BuildContext context) {
25-
final popupKey = GlobalKey<ToolbarPopupState>();
2638
return ToolbarPopup(
2739
key: popupKey,
28-
content: overflowContentBuilder,
40+
content: widget.overflowContentBuilder,
2941
verticalOffset: 8.0,
3042
horizontalOffset: 10.0,
3143
position: ToolbarPopupPosition.below,
@@ -38,7 +50,7 @@ class ToolbarOverflowButton extends StatelessWidget {
3850
onPressed: () {
3951
popupKey.currentState?.openPopup();
4052
},
41-
showLabel: isDense,
53+
showLabel: widget.isDense,
4254
).build(context, ToolbarItemDisplayMode.inToolbar),
4355
);
4456
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: macos_ui
22
description: Flutter widgets and themes implementing the current macOS design language.
3-
version: 2.1.2
3+
version: 2.1.3
44
homepage: "https://macosui.dev"
55
repository: "https://github.com/GroovinChip/macos_ui"
66

0 commit comments

Comments
 (0)