Skip to content

Commit 43720eb

Browse files
author
Franco Bugnano
committed
Changed the WebView to have a transparent background
1 parent fe145c5 commit 43720eb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/src/chatbox.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,18 @@ class ChatBoxState extends State<ChatBox> {
205205
initialSettings: InAppWebViewSettings(
206206
useHybridComposition: true,
207207
disableInputAccessoryView: true,
208+
transparentBackground: true,
208209
useShouldOverrideUrlLoading: true,
209210
),
210211
onWebViewCreated: _onWebViewCreated,
211212
onLoadStop: _onLoadStop,
212213
onConsoleMessage: (InAppWebViewController controller, ConsoleMessage message) {
213214
print("chatbox [${message.messageLevel}] ${message.message}");
214215
},
216+
gestureRecognizers: {
217+
// We need only the VerticalDragGestureRecognizer in order to be able to scroll through the messages
218+
Factory(() => VerticalDragGestureRecognizer()),
219+
},
215220
onGeolocationPermissionsShowPrompt: (InAppWebViewController controller, String origin) async {
216221
print("📘 chatbox onGeolocationPermissionsShowPrompt ($origin)");
217222

@@ -230,10 +235,6 @@ class ChatBoxState extends State<ChatBox> {
230235

231236
return PermissionResponse(resources: permissionRequest.resources, action: granted ? PermissionResponseAction.GRANT : PermissionResponseAction.DENY);
232237
},
233-
gestureRecognizers: {
234-
// We need only the VerticalDragGestureRecognizer in order to be able to scroll through the messages
235-
Factory(() => VerticalDragGestureRecognizer()),
236-
},
237238
shouldOverrideUrlLoading: (InAppWebViewController controller, NavigationAction navigationAction) async {
238239
if (navigationAction.navigationType == NavigationType.LINK_ACTIVATED) {
239240
if (await launchUrl(navigationAction.request.url!)) {

lib/src/conversationlist.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ class ConversationListState extends State<ConversationList> {
153153
initialSettings: InAppWebViewSettings(
154154
useHybridComposition: true,
155155
disableInputAccessoryView: true,
156+
transparentBackground: true,
156157
),
157158
onWebViewCreated: _onWebViewCreated,
158159
onLoadStop: _onLoadStop,

0 commit comments

Comments
 (0)