Skip to content

Commit 8fa4706

Browse files
authored
fix: clicking on CupertinoContextMenuAction doesn't close context menu (#3948)
* pop view when an action is clicked * cleanup * set MINIMAL_FLUTTER_VERSION = "3.24.0"
1 parent 92d4bab commit 8fa4706

File tree

5 files changed

+8
-14
lines changed

5 files changed

+8
-14
lines changed

packages/flet/lib/src/controls/cupertino_context_menu.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class _CupertinoContextMenuControlState
4444

4545
if (actionCtrls.isEmpty) {
4646
return const ErrorControl(
47-
"CupertinoContextMenu.actions must be provided and at least action must be visible");
47+
"CupertinoContextMenu.actions must be provided and at least one action must be visible");
4848
}
4949
if (contentCtrls.isEmpty) {
5050
return const ErrorControl(

packages/flet/lib/src/controls/cupertino_context_menu_action.dart

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,21 @@ class _CupertinoContextMenuActionControlState
4444
IconData? trailingIcon =
4545
parseIcon(widget.control.attrString("trailingIcon"));
4646

47-
Widget child = DefaultTextStyle(
48-
style: CupertinoTheme.of(context).textTheme.textStyle.copyWith(
49-
color:
50-
CupertinoDynamicColor.resolve(CupertinoColors.label, context)),
51-
child: contentCtrls.isNotEmpty
52-
? createControl(widget.control, contentCtrls.first.id, disabled,
53-
parentAdaptive: adaptive)
54-
: Text(text, overflow: TextOverflow.ellipsis));
55-
5647
return CupertinoContextMenuAction(
5748
isDefaultAction: widget.control.attrBool("isDefaultAction", false)!,
5849
isDestructiveAction:
5950
widget.control.attrBool("isDestructiveAction", false)!,
6051
onPressed: () {
6152
if (!disabled) {
6253
widget.backend.triggerControlEvent(widget.control.id, "click");
54+
Navigator.of(context).pop();
6355
}
6456
},
6557
trailingIcon: trailingIcon,
66-
child: child,
58+
child: contentCtrls.isNotEmpty
59+
? createControl(widget.control, contentCtrls.first.id, disabled,
60+
parentAdaptive: adaptive)
61+
: Text(text, overflow: TextOverflow.ellipsis),
6762
);
6863
}
6964
}

packages/flet/lib/src/controls/popup_menu_button.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ class PopupMenuButtonControl extends StatelessWidget with FletStoreMixin {
143143
}).toList(),
144144
child: child);
145145
});
146-
debugPrint('SHOW: ${control.attrString("tooltip", "") != ""}');
147146
return constrainedControl(
148147
context,
149148
TooltipVisibility(

sdk/python/packages/flet-cli/src/flet_cli/commands/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
PYODIDE_ROOT_URL = "https://cdn.jsdelivr.net/pyodide/v0.25.0/full"
3030
DEFAULT_TEMPLATE_URL = "gh:flet-dev/flet-build-template"
31-
MINIMAL_FLUTTER_VERSION = "3.19.0"
31+
MINIMAL_FLUTTER_VERSION = "3.24.0"
3232

3333
error_style = Style(color="red1")
3434
console = Console(log_path=False, style=Style(color="green", bold=True))

sdk/python/packages/flet-core/src/flet_core/audio_recorder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def get_input_devices(self, wait_timeout: Optional[float] = 5) -> dict:
218218
)
219219
return json.loads(devices)
220220

221-
async def get_input_devices_async(self, wait_timeout: Optional[float] = 5) -> bool:
221+
async def get_input_devices_async(self, wait_timeout: Optional[float] = 5) -> dict:
222222
devices = await self.invoke_method_async(
223223
"get_input_devices",
224224
wait_for_result=True,

0 commit comments

Comments
 (0)