Remove LogicalKeySet usage in one Shortcuts example (#156941)
## Description This PR replaces `LogicalKeySet` by `SingleActivator` in one of the Shortcuts example. According to [LogicalKeySet documentation](https://api.flutter.dev/flutter/widgets/LogicalKeySet-class.html) : "prefer [SingleActivator](https://api.flutter.dev/flutter/widgets/SingleActivator-class.html) when possible, whose behavior more closely resembles that of typical platforms". ## Related Issue Related to [LogicalKeySet Not Working on Linux Environment](https://github.com/flutter/flutter/issues/156806). ## Tests Adds 1 test.
This commit is contained in:
@@ -85,9 +85,9 @@ class _ShortcutsExampleState extends State<ShortcutsExample> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Shortcuts(
|
||||
shortcuts: <ShortcutActivator, Intent>{
|
||||
LogicalKeySet(LogicalKeyboardKey.arrowUp): const IncrementIntent(2),
|
||||
LogicalKeySet(LogicalKeyboardKey.arrowDown): const DecrementIntent(2),
|
||||
shortcuts: const <ShortcutActivator, Intent>{
|
||||
SingleActivator(LogicalKeyboardKey.arrowUp): IncrementIntent(2),
|
||||
SingleActivator(LogicalKeyboardKey.arrowDown): DecrementIntent(2),
|
||||
},
|
||||
child: Actions(
|
||||
actions: <Type, Action<Intent>>{
|
||||
|
||||
Reference in New Issue
Block a user