Skip to content

Commit f3a9780

Browse files
authored
fix autocomplete tap actions (#2540)
1 parent 8262772 commit f3a9780

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

packages/stream_chat_flutter/lib/src/message_input/stream_message_input.dart

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'dart:math';
77
import 'package:desktop_drop/desktop_drop.dart';
88
import 'package:flutter/material.dart';
99
import 'package:flutter/services.dart';
10-
import 'package:flutter_portal/flutter_portal.dart';
1110
import 'package:stream_chat_flutter/platform_widget_builder/src/platform_widget_builder.dart';
1211
import 'package:stream_chat_flutter/src/message_input/attachment_button.dart';
1312
import 'package:stream_chat_flutter/src/message_input/command_button.dart';
@@ -695,19 +694,17 @@ class StreamMessageInputState extends State<StreamMessageInput> with Restoration
695694
final elevation = widget.elevation ?? _messageInputTheme.elevation;
696695
final spacing = context.streamSpacing;
697696

698-
return Portal(
699-
child: Material(
700-
elevation: elevation ?? 8,
701-
child: DecoratedBox(
702-
decoration: BoxDecoration(
703-
color: context.streamColorScheme.backgroundElevation1,
704-
boxShadow: [if (shadow != null) shadow],
705-
),
706-
child: SimpleSafeArea(
707-
enabled: !_isPickerVisible && (widget.enableSafeArea ?? _messageInputTheme.enableSafeArea ?? true),
708-
minimum: _isPickerVisible ? .zero : .only(bottom: spacing.md),
709-
child: Center(heightFactor: 1, child: messageInput),
710-
),
697+
return Material(
698+
elevation: elevation ?? 8,
699+
child: DecoratedBox(
700+
decoration: BoxDecoration(
701+
color: context.streamColorScheme.backgroundElevation1,
702+
boxShadow: [if (shadow != null) shadow],
703+
),
704+
child: SimpleSafeArea(
705+
enabled: !_isPickerVisible && (widget.enableSafeArea ?? _messageInputTheme.enableSafeArea ?? true),
706+
minimum: _isPickerVisible ? .zero : .only(bottom: spacing.md),
707+
child: Center(heightFactor: 1, child: messageInput),
711708
),
712709
),
713710
);

packages/stream_chat_flutter/lib/src/stream_chat.dart

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:async';
22

33
import 'package:flutter/material.dart';
4+
import 'package:flutter_portal/flutter_portal.dart';
45
import 'package:stream_chat_flutter/src/misc/empty_widget.dart';
56
import 'package:stream_chat_flutter/src/video/vlc/vlc_manager.dart';
67
import 'package:stream_chat_flutter/stream_chat_flutter.dart';
@@ -154,34 +155,36 @@ class StreamChatState extends State<StreamChat> {
154155
@override
155156
Widget build(BuildContext context) {
156157
final theme = _getTheme(context, widget.streamChatThemeData);
157-
return StreamChatConfiguration(
158-
data: streamChatConfigData,
159-
child: StreamChatTheme(
160-
data: theme,
161-
child: Builder(
162-
builder: (context) {
163-
final materialTheme = Theme.of(context);
164-
final streamTheme = StreamChatTheme.of(context);
165-
return Theme(
166-
data: materialTheme.copyWith(
167-
primaryIconTheme: streamTheme.primaryIconTheme,
168-
colorScheme: materialTheme.colorScheme.copyWith(
169-
secondary: streamTheme.colorTheme.accentPrimary,
158+
return Portal(
159+
child: StreamChatConfiguration(
160+
data: streamChatConfigData,
161+
child: StreamChatTheme(
162+
data: theme,
163+
child: Builder(
164+
builder: (context) {
165+
final materialTheme = Theme.of(context);
166+
final streamTheme = StreamChatTheme.of(context);
167+
return Theme(
168+
data: materialTheme.copyWith(
169+
primaryIconTheme: streamTheme.primaryIconTheme,
170+
colorScheme: materialTheme.colorScheme.copyWith(
171+
secondary: streamTheme.colorTheme.accentPrimary,
172+
),
170173
),
171-
),
172-
child: StreamChatCore(
173-
client: client,
174-
onBackgroundEventReceived: widget.onBackgroundEventReceived,
175-
backgroundKeepAlive: widget.backgroundKeepAlive,
176-
connectivityStream: widget.connectivityStream,
177-
child: Builder(
178-
builder: (context) {
179-
return widget.child ?? const Empty();
180-
},
174+
child: StreamChatCore(
175+
client: client,
176+
onBackgroundEventReceived: widget.onBackgroundEventReceived,
177+
backgroundKeepAlive: widget.backgroundKeepAlive,
178+
connectivityStream: widget.connectivityStream,
179+
child: Builder(
180+
builder: (context) {
181+
return widget.child ?? const Empty();
182+
},
183+
),
181184
),
182-
),
183-
);
184-
},
185+
);
186+
},
187+
),
185188
),
186189
),
187190
);

0 commit comments

Comments
 (0)