Skip to content

Commit

Permalink
Set toolbarTopBackgroundColor to manifest theme color
Browse files Browse the repository at this point in the history
  • Loading branch information
PrimozRatej committed Jun 22, 2023
1 parent 083e707 commit 71c70b1
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/components/in_app_browser.dart
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import 'dart:async';
import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:humhub/models/manifest.dart';
import 'package:humhub/util/extensions.dart';

class MyInAppBrowser extends InAppBrowser {
final Manifest manifest;
final InAppBrowserClassOptions options = InAppBrowserClassOptions(
crossPlatform: InAppBrowserOptions(hideUrlBar: false, toolbarTopBackgroundColor: Colors.grey),
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(javaScriptEnabled: true, useShouldOverrideUrlLoading: true),
),
);

late InAppBrowserClassOptions options;
final Function concludeAuth;

MyInAppBrowser({required this.manifest, required this.concludeAuth});
MyInAppBrowser({required this.manifest, required this.concludeAuth}) {
options = InAppBrowserClassOptions(
crossPlatform: InAppBrowserOptions(hideUrlBar: false, toolbarTopBackgroundColor: HexColor(manifest.themeColor)),
inAppWebViewGroupOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(javaScriptEnabled: true, useShouldOverrideUrlLoading: true),
),
);
}

@override
Future<NavigationActionPolicy?>? shouldOverrideUrlLoading(NavigationAction navigationAction) async {
Expand Down

0 comments on commit 71c70b1

Please sign in to comment.