diff --git a/playground/frontend/integration_test/common/common_finders.dart b/playground/frontend/integration_test/common/common_finders.dart index d0863dbfcbb7..af49b996b540 100644 --- a/playground/frontend/integration_test/common/common_finders.dart +++ b/playground/frontend/integration_test/common/common_finders.dart @@ -26,7 +26,7 @@ import 'package:playground/modules/examples/components/description_popover/descr import 'package:playground/modules/examples/example_selector.dart'; import 'package:playground/modules/sdk/components/sdk_selector.dart'; import 'package:playground/modules/sdk/components/sdk_selector_row.dart'; -import 'package:playground/modules/shortcuts/components/shortcuts_modal.dart'; +import 'package:playground/modules/shortcuts/components/shortcuts_dialog.dart'; import 'package:playground/pages/standalone_playground/widgets/editor_textarea_wrapper.dart'; import 'package:playground/pages/standalone_playground/widgets/feedback/feedback_dropdown_content.dart'; import 'package:playground/pages/standalone_playground/widgets/feedback/playground_feedback.dart'; @@ -117,6 +117,6 @@ extension CommonFindersExtension on CommonFinders { } Finder shortcutsModal() { - return byType(ShortcutsModal); + return byType(ShortcutsDialogContent); } } diff --git a/playground/frontend/integration_test/miscellaneous_ui/shortcuts_modal_test.dart b/playground/frontend/integration_test/miscellaneous_ui/shortcuts_modal_test.dart index e12752abef3c..4b9b1a9fc3b5 100644 --- a/playground/frontend/integration_test/miscellaneous_ui/shortcuts_modal_test.dart +++ b/playground/frontend/integration_test/miscellaneous_ui/shortcuts_modal_test.dart @@ -38,7 +38,7 @@ Future checkShortcutsModal(WidgetTester wt) async { expect(find.shortcutsModal(), findsOneWidget); - await wt.tap(find.text(appLocale.close)); + await wt.sendKeyEvent(LogicalKeyboardKey.escape); await wt.pumpAndSettle(); expect(find.shortcutsModal(), findsNothing); diff --git a/playground/frontend/integration_test/standalone_editing_test.dart b/playground/frontend/integration_test/standalone_editing_test.dart index 83a4d433fd33..4b71cac107c0 100644 --- a/playground/frontend/integration_test/standalone_editing_test.dart +++ b/playground/frontend/integration_test/standalone_editing_test.dart @@ -43,9 +43,7 @@ Future _checkAutocomplete(WidgetTester wt) async { await wt.enterCodeFieldText('\n\n\n\n\nsdk'); final playgroundController = wt.findPlaygroundController(); - await wt.runShortcut( - playgroundController.showSuggestionsShortcut.shortcuts, - ); + await wt.runShortcut(playgroundController.showSuggestionsShortcut); await wt.pumpAndSettle(); expect(find.text('sdkHttpMetadata'), findsOneWidget); diff --git a/playground/frontend/integration_test/standalone_run_shortcuts_test.dart b/playground/frontend/integration_test/standalone_run_shortcuts_test.dart index 188cc0a2d2a2..85d71e282218 100644 --- a/playground/frontend/integration_test/standalone_run_shortcuts_test.dart +++ b/playground/frontend/integration_test/standalone_run_shortcuts_test.dart @@ -50,7 +50,7 @@ Future _checkResetShortcut( expect(controller.source, isNot(startSource)); - await wt.runShortcut(controller.resetShortcut.shortcuts); + await wt.runShortcut(controller.resetShortcut); await wt.pumpAndSettle(); expect(startSource, controller.source); @@ -61,7 +61,7 @@ Future _checkRunShortcut( PlaygroundController controller, ) async { final output = controller.codeRunner.resultLogOutput; - await wt.runShortcut(controller.runShortcut.shortcuts); + await wt.runShortcut(controller.runShortcut); await wt.pumpAndSettle(); expect(output, isNot(controller.codeRunner.resultLogOutput)); @@ -74,7 +74,7 @@ Future _checkClearOutputShortcut( expect(controller.codeRunner.resultLogOutput, isNotEmpty); expect(controller.codeRunner.resultLogOutput, isNotNull); - await wt.runShortcut(kClearOutputShortcut.shortcuts); + await wt.runShortcut(kClearOutputShortcut); await wt.pumpAndSettle(); expect(controller.codeRunner.resultLogOutput, isEmpty); diff --git a/playground/frontend/lib/modules/shortcuts/components/shortcuts_dialog.dart b/playground/frontend/lib/modules/shortcuts/components/shortcuts_dialog.dart new file mode 100644 index 000000000000..4ebc14acdffe --- /dev/null +++ b/playground/frontend/lib/modules/shortcuts/components/shortcuts_dialog.dart @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; +import 'package:playground/constants/font_weight.dart'; +import 'package:playground/constants/sizes.dart'; +import 'package:playground/modules/shortcuts/components/shortcut_row.dart'; +import 'package:playground/modules/shortcuts/constants/global_shortcuts.dart'; +import 'package:playground_components/playground_components.dart'; + +class ShortcutsDialogContent extends StatelessWidget { + static const _kModalMaxWidth = 400.0; + static const _kShortcutsMaxWidth = 200.0; + + const ShortcutsDialogContent({ + required this.playgroundController, + }); + + final PlaygroundController playgroundController; + + @override + Widget build(BuildContext context) { + return SizedBox( + width: _kModalMaxWidth, + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + mainAxisSize: MainAxisSize.min, + children: [ + ...[ + ...playgroundController.shortcuts, + ...globalShortcuts, + ] + .map( + (shortcut) => Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + ConstrainedBox( + constraints: + const BoxConstraints(maxWidth: _kShortcutsMaxWidth), + child: ShortcutRow(shortcut: shortcut), + ), + const SizedBox(width: kMdSpacing), + Expanded( + child: Text( + shortcut.actionIntent.slug.tr(), + style: const TextStyle(fontWeight: kBoldWeight), + ), + ), + ], + ), + ) + .alternateWith( + const SizedBox( + height: kXlSpacing, + ), + ), + ], + ), + ); + } +} diff --git a/playground/frontend/lib/modules/shortcuts/components/shortcuts_modal.dart b/playground/frontend/lib/modules/shortcuts/components/shortcuts_modal.dart deleted file mode 100644 index f4332e55ebd4..000000000000 --- a/playground/frontend/lib/modules/shortcuts/components/shortcuts_modal.dart +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import 'package:easy_localization/easy_localization.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_gen/gen_l10n/app_localizations.dart'; -import 'package:playground/constants/font_weight.dart'; -import 'package:playground/constants/sizes.dart'; -import 'package:playground/modules/shortcuts/components/shortcut_row.dart'; -import 'package:playground/modules/shortcuts/constants/global_shortcuts.dart'; -import 'package:playground_components/playground_components.dart'; - -const kButtonBorderRadius = 24.0; -const kButtonWidth = 120.0; -const kButtonHeight = 40.0; -const kDialogPadding = 40.0; - -class ShortcutsModal extends StatelessWidget { - final PlaygroundController playgroundController; - - const ShortcutsModal({ - required this.playgroundController, - }); - - @override - Widget build(BuildContext context) { - AppLocalizations appLocale = AppLocalizations.of(context)!; - - return AlertDialog( - title: Text(appLocale.shortcuts), - titlePadding: const EdgeInsets.only( - top: kDialogPadding, - left: kDialogPadding, - ), - contentPadding: const EdgeInsets.all(kDialogPadding), - actionsPadding: const EdgeInsets.only( - bottom: kDialogPadding, - right: kDialogPadding, - ), - content: Wrap( - crossAxisAlignment: WrapCrossAlignment.start, - runSpacing: kXlSpacing, - children: [ - ...[ - ...playgroundController.shortcuts, - ...globalShortcuts, - ].map( - (shortcut) => Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Expanded(child: ShortcutRow(shortcut: shortcut)), - const SizedBox(width: kMdSpacing), - Expanded( - flex: 3, - child: Text( - shortcut.actionIntent.slug.tr(), - style: const TextStyle(fontWeight: kBoldWeight), - ), - ), - ], - ), - ) - ], - ), - actions: [ - ElevatedButton( - style: ButtonStyle( - elevation: MaterialStateProperty.all(0.0), - fixedSize: MaterialStateProperty.all( - const Size(kButtonWidth, kButtonHeight), - ), - shape: MaterialStateProperty.all( - const StadiumBorder(), - ), - ), - onPressed: () => Navigator.of(context).pop(), - child: Text(appLocale.close), - ), - ], - ); - } -} diff --git a/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart b/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart index 2745c20ebdb7..4c762e1c6c31 100644 --- a/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart +++ b/playground/frontend/lib/modules/shortcuts/constants/global_shortcuts.dart @@ -31,10 +31,10 @@ class NewExampleIntent extends BeamIntent { } final kClearOutputShortcut = BeamShortcut( - shortcuts: LogicalKeySet( + keys: [ LogicalKeyboardKeyExtension.metaOrControl, LogicalKeyboardKey.keyB, - ), + ], actionIntent: const ClearOutputIntent(), createAction: (BuildContext context) => CallbackAction( onInvoke: (_) => Provider.of( @@ -45,10 +45,10 @@ final kClearOutputShortcut = BeamShortcut( ); final kNewExampleShortcut = BeamShortcut( - shortcuts: LogicalKeySet( + keys: [ LogicalKeyboardKeyExtension.metaOrControl, LogicalKeyboardKey.keyM, - ), + ], actionIntent: const NewExampleIntent(), createAction: (_) => CallbackAction( onInvoke: (_) => launchUrl(Uri.parse('/')), diff --git a/playground/frontend/lib/pages/standalone_playground/widgets/more_actions.dart b/playground/frontend/lib/pages/standalone_playground/widgets/more_actions.dart index 3a313ed522f1..20be1db15a11 100644 --- a/playground/frontend/lib/pages/standalone_playground/widgets/more_actions.dart +++ b/playground/frontend/lib/pages/standalone_playground/widgets/more_actions.dart @@ -25,7 +25,7 @@ import 'package:url_launcher/url_launcher.dart'; import '../../../constants/links.dart'; import '../../../modules/analytics/analytics_service.dart'; -import '../../../modules/shortcuts/components/shortcuts_modal.dart'; +import '../../../modules/shortcuts/components/shortcuts_dialog.dart'; import '../../../src/assets/assets.gen.dart'; enum HeaderAction { @@ -85,9 +85,11 @@ class _MoreActionsState extends State { title: Text(appLocale.shortcuts), onTap: () { AnalyticsService.get(context).trackOpenShortcutsModal(); - showDialog( + BeamDialog.show( + actions: [BeamCloseButton()], context: context, - builder: (BuildContext context) => ShortcutsModal( + title: Text(appLocale.shortcuts), + child: ShortcutsDialogContent( playgroundController: widget.playgroundController, ), ); diff --git a/playground/frontend/playground_components/assets/translations/en.yaml b/playground/frontend/playground_components/assets/translations/en.yaml index d13565223a33..7822c979686c 100644 --- a/playground/frontend/playground_components/assets/translations/en.yaml +++ b/playground/frontend/playground_components/assets/translations/en.yaml @@ -43,6 +43,9 @@ widgets: codeEditor: label: 'Code Text Area' + + closeButton: + label: 'Close' output: filter: diff --git a/playground/frontend/playground_components/lib/playground_components.dart b/playground/frontend/playground_components/lib/playground_components.dart index 020fdc4b7a6b..92d86e4119e4 100644 --- a/playground/frontend/playground_components/lib/playground_components.dart +++ b/playground/frontend/playground_components/lib/playground_components.dart @@ -59,12 +59,14 @@ export 'src/services/symbols/loaders/yaml.dart'; export 'src/theme/switch_notifier.dart'; export 'src/theme/theme.dart'; export 'src/util/async.dart'; +export 'src/util/iterable.dart'; export 'src/util/logical_keyboard_key.dart'; export 'src/util/pipeline_options.dart'; export 'src/util/string.dart'; export 'src/widgets/bubble.dart'; export 'src/widgets/clickable.dart'; +export 'src/widgets/close_button.dart'; export 'src/widgets/complexity.dart'; export 'src/widgets/dialog.dart'; export 'src/widgets/divider.dart'; diff --git a/playground/frontend/playground_components/lib/src/controllers/playground_controller.dart b/playground/frontend/playground_components/lib/src/controllers/playground_controller.dart index f380af4cc02d..e3fca592449c 100644 --- a/playground/frontend/playground_components/lib/src/controllers/playground_controller.dart +++ b/playground/frontend/playground_components/lib/src/controllers/playground_controller.dart @@ -312,10 +312,10 @@ class PlaygroundController with ChangeNotifier { } late BeamShortcut runShortcut = BeamShortcut( - shortcuts: LogicalKeySet( + keys: [ LogicalKeyboardKeyExtension.metaOrControl, LogicalKeyboardKey.enter, - ), + ], actionIntent: const RunIntent(), createAction: (BuildContext context) => CallbackAction( onInvoke: (_) => codeRunner.runCode(), @@ -323,11 +323,11 @@ class PlaygroundController with ChangeNotifier { ); late BeamShortcut resetShortcut = BeamShortcut( - shortcuts: LogicalKeySet( + keys: [ LogicalKeyboardKeyExtension.metaOrControl, LogicalKeyboardKey.shift, LogicalKeyboardKey.keyE, - ), + ], actionIntent: const ResetIntent(), createAction: (BuildContext context) => CallbackAction( onInvoke: (_) => reset(), @@ -335,11 +335,11 @@ class PlaygroundController with ChangeNotifier { ); late BeamShortcut showSuggestionsShortcut = BeamShortcut( - shortcuts: LogicalKeySet( + keys: [ LogicalKeyboardKeyExtension.metaOrControl, LogicalKeyboardKey.shift, LogicalKeyboardKey.keyS, - ), + ], actionIntent: const ShowSuggestionsIntent(), createAction: (BuildContext context) => CallbackAction( onInvoke: (_) => showSuggestions(), diff --git a/playground/frontend/playground_components/lib/src/models/shortcut.dart b/playground/frontend/playground_components/lib/src/models/shortcut.dart index ff4ede80f91d..1f3a3898b7e6 100644 --- a/playground/frontend/playground_components/lib/src/models/shortcut.dart +++ b/playground/frontend/playground_components/lib/src/models/shortcut.dart @@ -22,26 +22,32 @@ import 'package:flutter/services.dart'; import 'intents.dart'; class BeamShortcut { - final LogicalKeySet shortcuts; + // Keys in the order to be shown or mocked. + // + // A list is required because a [LogicalKeySet] discards the original order. + final List keys; + + LogicalKeySet get keySet => LogicalKeySet.fromSet(keys.toSet()); + final BeamIntent actionIntent; final CallbackAction Function(BuildContext) createAction; BeamShortcut({ - required this.shortcuts, + required this.keys, required this.actionIntent, required this.createAction, }); - static const _metaKeyName = 'CMD/CTRL'; + static const _metaKeyName = 'Command'; static const _glue = ' + '; String get title { - return shortcuts.keys - .map(getKeyDisplayName) + return keys + .map(_getKeyDisplayName) .join(_glue); } - String getKeyDisplayName(LogicalKeyboardKey e) { + String _getKeyDisplayName(LogicalKeyboardKey e) { if (e.keyId == LogicalKeyboardKey.meta.keyId) { return _metaKeyName; } diff --git a/playground/frontend/playground_components/lib/src/util/iterable.dart b/playground/frontend/playground_components/lib/src/util/iterable.dart new file mode 100644 index 000000000000..3ce5b6f88b46 --- /dev/null +++ b/playground/frontend/playground_components/lib/src/util/iterable.dart @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +extension IterableExtension on Iterable { + Iterable alternateWith(T separator) { + return expand((item) sync* { + yield separator; + yield item as T; + }).skip(1); + } +} diff --git a/playground/frontend/playground_components/lib/src/widgets/close_button.dart b/playground/frontend/playground_components/lib/src/widgets/close_button.dart new file mode 100644 index 000000000000..868e53fa920d --- /dev/null +++ b/playground/frontend/playground_components/lib/src/widgets/close_button.dart @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:easy_localization/easy_localization.dart'; +import 'package:flutter/material.dart'; + +class BeamCloseButton extends StatelessWidget { + static const _width = 120.0; + static const _height = 40.0; + + @override + Widget build(BuildContext context) { + return ElevatedButton( + style: const ButtonStyle( + elevation: MaterialStatePropertyAll(0), + fixedSize: MaterialStatePropertyAll( + Size(_width, _height), + ), + shape: MaterialStatePropertyAll( + StadiumBorder(), + ), + padding: MaterialStatePropertyAll(EdgeInsets.only(bottom: 2)), + ), + onPressed: () => Navigator.of(context).pop(), + child: Text('widgets.closeButton.label'.tr().toUpperCase()), + ); + } +} diff --git a/playground/frontend/playground_components/lib/src/widgets/dialog.dart b/playground/frontend/playground_components/lib/src/widgets/dialog.dart index 1a0a0c8e4d92..7e14d481649e 100644 --- a/playground/frontend/playground_components/lib/src/widgets/dialog.dart +++ b/playground/frontend/playground_components/lib/src/widgets/dialog.dart @@ -20,11 +20,15 @@ import 'package:flutter/material.dart'; // TODO(alexeyinkin): In future convert all dialogs to this one. class BeamDialog extends StatelessWidget { + static const _padding = 40.0; + const BeamDialog({ required this.child, + this.actions = const [], this.title, }); + final List actions; final Widget child; final Widget? title; @@ -32,20 +36,33 @@ class BeamDialog extends StatelessWidget { required Widget child, required BuildContext context, Widget? title, + List actions = const [], }) async { await showDialog( context: context, builder: (BuildContext context) => BeamDialog( - child: AlertDialog( - title: title, - content: child, - ), + actions: actions, + title: title, + child: child, ), ); } @override Widget build(BuildContext context) { - return child; + return AlertDialog( + actions: actions, + actionsPadding: const EdgeInsets.only( + bottom: _padding, + right: _padding, + ), + content: child, + contentPadding: const EdgeInsets.all(_padding), + title: title, + titlePadding: const EdgeInsets.only( + top: _padding, + left: _padding, + ), + ); } } diff --git a/playground/frontend/playground_components/lib/src/widgets/shortcuts_manager.dart b/playground/frontend/playground_components/lib/src/widgets/shortcuts_manager.dart index 2006c7662e7e..d5184961f3af 100644 --- a/playground/frontend/playground_components/lib/src/widgets/shortcuts_manager.dart +++ b/playground/frontend/playground_components/lib/src/widgets/shortcuts_manager.dart @@ -43,7 +43,7 @@ class ShortcutsManager extends StatelessWidget { Map get _shortcutsMap => { for (var shortcut in shortcuts) - shortcut.shortcuts: shortcut.actionIntent + shortcut.keySet: shortcut.actionIntent }; Map> _getActions(BuildContext context) => { diff --git a/playground/frontend/playground_components/test/src/models/shortcut_test.dart b/playground/frontend/playground_components/test/src/models/shortcut_test.dart new file mode 100644 index 000000000000..db982e9bbc1f --- /dev/null +++ b/playground/frontend/playground_components/test/src/models/shortcut_test.dart @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import 'package:flutter/services.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:playground_components/playground_components.dart'; + +void main() { + group( + 'BeamShortcut test.', + () { + test( + 'Title builds correctly', + () { + const meta = 'Command'; + final shortcutsAndTitles = { + // + _buildShortcut([ + LogicalKeyboardKey.meta, + LogicalKeyboardKey.enter, + ]): '$meta + Enter', + + _buildShortcut([ + LogicalKeyboardKey.enter, + LogicalKeyboardKey.meta, + ]): 'Enter + $meta', + + _buildShortcut([ + LogicalKeyboardKey.meta, + LogicalKeyboardKey.shift, + LogicalKeyboardKey.keyS, + ]): '$meta + Shift + S', + + _buildShortcut([ + LogicalKeyboardKey.meta, + LogicalKeyboardKey.alt, + LogicalKeyboardKey.shift, + LogicalKeyboardKey.keyS, + ]): '$meta + Alt + Shift + S', + + _buildShortcut([ + LogicalKeyboardKey.control, + LogicalKeyboardKey.alt, + LogicalKeyboardKey.shift, + LogicalKeyboardKey.keyS, + ]): 'Control + Alt + Shift + S', + }; + + for (final entry in shortcutsAndTitles.entries) { + expect(entry.key.title, entry.value); + } + }, + ); + }, + ); +} + +BeamShortcut _buildShortcut(List keys) { + return BeamShortcut( + keys: keys, + actionIntent: const BeamIntent( + slug: 'slug', + ), + createAction: (_) => CallbackAction( + onInvoke: (_) { + return null; + }, + ), + ); +} diff --git a/playground/frontend/playground_components_dev/lib/src/examples/python/aggregation_mean.dart b/playground/frontend/playground_components_dev/lib/src/examples/python/aggregation_mean.dart index e18ac22f502e..7c91e14277f1 100644 --- a/playground/frontend/playground_components_dev/lib/src/examples/python/aggregation_mean.dart +++ b/playground/frontend/playground_components_dev/lib/src/examples/python/aggregation_mean.dart @@ -27,5 +27,5 @@ const pythonAggregationMean = ExampleDescriptor( path: '/learning/katas/python/Common Transforms/Aggregation/Mean/task.py', sdk: Sdk.python, - outputContains: ['16 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]'], + outputContains: ['5.5'], ); diff --git a/playground/frontend/playground_components_dev/lib/src/widget_tester.dart b/playground/frontend/playground_components_dev/lib/src/widget_tester.dart index 730d05154f25..112446c97582 100644 --- a/playground/frontend/playground_components_dev/lib/src/widget_tester.dart +++ b/playground/frontend/playground_components_dev/lib/src/widget_tester.dart @@ -77,7 +77,7 @@ extension WidgetTesterExtension on WidgetTester { return context.read(); } - Future runShortcut(LogicalKeySet shortcut) async { + Future runShortcut(BeamShortcut shortcut) async { final list = shortcut.keys.toList(); for (final key in list) { await sendKeyDownEvent(key);