From acca34b46063a46e79839821087aebf7ea89fc05 Mon Sep 17 00:00:00 2001 From: primozratej Date: Fri, 1 Nov 2024 12:20:16 +0100 Subject: [PATCH] Add close button on AuthInAppBrowser --- lib/util/auth_in_app_browser.dart | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lib/util/auth_in_app_browser.dart b/lib/util/auth_in_app_browser.dart index b1294e8..f532e2a 100644 --- a/lib/util/auth_in_app_browser.dart +++ b/lib/util/auth_in_app_browser.dart @@ -1,8 +1,11 @@ import 'dart:async'; +import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:humhub/models/manifest.dart'; import 'package:loggy/loggy.dart'; +import 'extensions.dart'; + class AuthInAppBrowser extends InAppBrowser { final Manifest manifest; late InAppBrowserClassSettings settings; @@ -14,17 +17,16 @@ class AuthInAppBrowser extends InAppBrowser { settings = InAppBrowserClassSettings( browserSettings: InAppBrowserSettings( hideUrlBar: true, - hideToolbarTop: true, - closeOnCannotGoBack: true, shouldCloseOnBackButtonPressed: true, - hideToolbarBottom: true, - presentationStyle: ModalPresentationStyle.POPOVER, + toolbarTopBackgroundColor: Colors.white, + toolbarTopTintColor: HexColor(manifest.themeColor), + presentationStyle: ModalPresentationStyle.PAGE_SHEET, ), webViewSettings: InAppWebViewSettings( - javaScriptEnabled: true, - useShouldOverrideUrlLoading: true, - userAgent: userAgent, - applicationNameForUserAgent: 'HumHub-Mobile'), + javaScriptEnabled: true, + useShouldOverrideUrlLoading: true, + userAgent: userAgent, + ), ); }