File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ## [ 2.2.2]
2+ ### 🛠 Fixed 🛠
3+ - Fixed setState called after dispose issue in MacosPulldownButton.
4+
15## [ 2.2.1]
26### 🔄 Updated 🔄
37* Wrap toolbar items with ` MacosToolbarPassthrough ` to prevent window move or resize when interacting with toolbar items.
Original file line number Diff line number Diff line change @@ -835,9 +835,9 @@ class _MacosPulldownButtonState extends State<MacosPulldownButton>
835835 );
836836
837837 navigator.push (_pulldownRoute! ).then <void >((_) {
838+ if (! mounted) return ;
838839 setState (() => _pullDownButtonState = PulldownButtonState .enabled);
839840 _removeMacosPulldownRoute ();
840- if (! mounted) return ;
841841 });
842842
843843 widget.onTap? .call ();
Original file line number Diff line number Diff line change 11name : macos_ui
22description : Flutter widgets and themes implementing the current macOS design language.
3- version : 2.2.1
3+ version : 2.2.2
44homepage : " https://macosui.dev"
55repository : " https://github.com/GroovinChip/macos_ui"
66
Original file line number Diff line number Diff line change @@ -57,6 +57,48 @@ void main() {
5757 expect (mockOnPressedFunction.called, 2 );
5858 });
5959
60+ testWidgets ('MacosPulldownButton displays correctly items ' ,
61+ (WidgetTester tester) async {
62+ await tester.pumpWidget (MacosApp (
63+ home: MacosWindow (
64+ child: MacosScaffold (
65+ children: [
66+ ContentArea (
67+ builder: (context, _) {
68+ return Center (
69+ child: MacosPulldownButton (
70+ title: "Menu" ,
71+ items: [
72+ MacosPulldownMenuItem (
73+ title: const Text ('New folder' ),
74+ onTap: () {},
75+ ),
76+ MacosPulldownMenuItem (
77+ title: const Text ('Document' ),
78+ onTap: () {},
79+ ),
80+ ],
81+ ),
82+ );
83+ },
84+ ),
85+ ],
86+ ),
87+ ),
88+ ));
89+
90+ // Verify that the title is rendered on the button.
91+ expect (find.text ('Menu' ), findsOneWidget);
92+
93+ // tap on the button to open the pulldown menu.
94+ await tester.tap (find.text ('Menu' ));
95+ await tester.pumpAndSettle ();
96+
97+ // Verify that the menu items are displayed.
98+ expect (find.text ('New folder' ), findsOneWidget);
99+ expect (find.text ('Document' ), findsOneWidget);
100+ });
101+
60102 testWidgets (
61103 'MacosPulldownButtonItems\' onTap callback is called when defined' ,
62104 (WidgetTester tester) async {
You can’t perform that action at this time.
0 commit comments