forked from picnic-app-cool/picnic-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb_view_route.dart
32 lines (29 loc) · 1.08 KB
/
web_view_route.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import 'package:flutter/material.dart';
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
import 'package:picnic_app/navigation/app_navigator.dart';
import 'package:picnic_ui_components/ui/theme/picnic_theme.dart';
mixin WebViewRoute {
Future<void> openWebView(String url) async {
final blackAndWhite = PicnicTheme.of(context).colors.blackAndWhite;
final whiteColor = blackAndWhite.shade100;
final blackColor = blackAndWhite.shade900;
return launch(
url,
customTabsOption: CustomTabsOption(
enableDefaultShare: true,
enableUrlBarHiding: true,
showPageTitle: true,
animation: CustomTabsSystemAnimation.slideIn(),
),
safariVCOption: SafariViewControllerOption(
preferredBarTintColor: whiteColor,
preferredControlTintColor: blackColor,
barCollapsingEnabled: true,
entersReaderIfAvailable: false,
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
),
);
}
AppNavigator get appNavigator;
BuildContext get context => AppNavigator.currentContext;
}