refactor(ui): rename portal to overlays

This commit is contained in:
Salvatore Giordano
2021-09-22 09:24:36 +02:00
parent 152adfc8b0
commit 9a1cb38e2a
2 changed files with 30 additions and 30 deletions
@@ -192,15 +192,15 @@ class MessageInput extends StatefulWidget {
this.onAttachmentLimitExceed,
this.attachmentButtonBuilder,
this.commandButtonBuilder,
this.customPortalOptions = const [],
this.customOverlays = const [],
}) : assert(
initialMessage == null || editMessage == null,
"Can't provide both `initialMessage` and `editMessage`",
),
super(key: key);
/// List of portal options for showing overlays
final List<PortalOptions> customPortalOptions;
/// List of options for showing overlays
final List<OverlayOptions> customOverlays;
/// Message to edit
final Message? editMessage;
@@ -466,15 +466,15 @@ class MessageInputState extends State<MessageInput> {
);
}
return MultiPortal(
return MultiOverlay(
childAnchor: Alignment.topCenter,
portalAnchor: Alignment.bottomCenter,
portalOptions: [
PortalOptions(
overlayAnchor: Alignment.bottomCenter,
overlayOptions: [
OverlayOptions(
visible: _showCommandsOverlay,
widget: _buildCommandsOverlayEntry(),
),
PortalOptions(
OverlayOptions(
visible: _focusNode.hasFocus &&
textEditingController.text.isNotEmpty &&
textEditingController.selection.baseOffset > 0 &&
@@ -486,11 +486,11 @@ class MessageInputState extends State<MessageInput> {
.contains(':'),
widget: _buildEmojiOverlay(),
),
PortalOptions(
OverlayOptions(
visible: _showMentionsOverlay,
widget: _buildMentionsOverlayEntry(),
),
...widget.customPortalOptions,
...widget.customOverlays,
],
child: child,
);