Skip to content

Commit

Permalink
Add close button on AuthInAppBrowser
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozRatej committed Nov 1, 2024
1 parent 12682f0 commit acca34b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions lib/util/auth_in_app_browser.dart
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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,
),
);
}

Expand Down

0 comments on commit acca34b

Please sign in to comment.