|
|
|
@ -265,14 +265,19 @@ class InputBar extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final useShortCuts = (PlatformInfos.isWeb || PlatformInfos.isDesktop);
|
|
|
|
|
return Shortcuts(
|
|
|
|
|
shortcuts: {
|
|
|
|
|
shortcuts: !useShortCuts
|
|
|
|
|
? {}
|
|
|
|
|
: {
|
|
|
|
|
LogicalKeySet(LogicalKeyboardKey.shift, LogicalKeyboardKey.enter):
|
|
|
|
|
NewLineIntent(),
|
|
|
|
|
LogicalKeySet(LogicalKeyboardKey.enter): SubmitLineIntent(),
|
|
|
|
|
},
|
|
|
|
|
child: Actions(
|
|
|
|
|
actions: {
|
|
|
|
|
actions: !useShortCuts
|
|
|
|
|
? {}
|
|
|
|
|
: {
|
|
|
|
|
NewLineIntent: CallbackAction(onInvoke: (i) {
|
|
|
|
|
final val = controller.value;
|
|
|
|
|
final selection = val.selection.start;
|
|
|
|
@ -289,9 +294,7 @@ class InputBar extends StatelessWidget {
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
SubmitLineIntent: CallbackAction(onInvoke: (i) {
|
|
|
|
|
if (PlatformInfos.isWeb || PlatformInfos.isDesktop) {
|
|
|
|
|
onSubmitted(controller.text);
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|