Only create and use the correct rich text controller for each platform
This commit is contained in:
@@ -149,14 +149,7 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
child: FocusScope(
|
||||
child: Focus(
|
||||
onFocusChange: (focus) => widget.onFocusEmailAddressChangeAction?.call(widget.prefix, focus),
|
||||
onKey: (focusNode, event) {
|
||||
if (event is RawKeyDownEvent && event.logicalKey == LogicalKeyboardKey.tab) {
|
||||
widget.nextFocusNode?.requestFocus();
|
||||
widget.onFocusNextAddressAction?.call();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
},
|
||||
onKey: PlatformInfo.isWeb ? _recipientInputOnKeyListener : null,
|
||||
child: StatefulBuilder(
|
||||
builder: (context, stateSetter) {
|
||||
if (PlatformInfo.isWeb || widget.isTestingForWeb) {
|
||||
@@ -389,6 +382,15 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
KeyEventResult _recipientInputOnKeyListener(FocusNode node, RawKeyEvent event) {
|
||||
if (event is RawKeyDownEvent && event.logicalKey == LogicalKeyboardKey.tab) {
|
||||
widget.nextFocusNode?.requestFocus();
|
||||
widget.onFocusNextAddressAction?.call();
|
||||
return KeyEventResult.handled;
|
||||
}
|
||||
return KeyEventResult.ignored;
|
||||
}
|
||||
|
||||
bool get _isCollapse => _currentListEmailAddress.length > 1 && widget.expandMode == ExpandMode.COLLAPSE;
|
||||
|
||||
bool get _isAllRecipientInputEnabled => widget.fromState == PrefixRecipientState.enabled
|
||||
|
||||
Reference in New Issue
Block a user