Skip to content

Commit

Permalink
Add Formula E (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrightDV committed Jul 4, 2024
1 parent a3cb853 commit 68dbadb
Show file tree
Hide file tree
Showing 35 changed files with 3,995 additions and 1,837 deletions.
12 changes: 6 additions & 6 deletions lib/Screens/SessionWebView/unofficial_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:hive_flutter/hive_flutter.dart';

class UnofficialWebviewScreen extends StatefulWidget {
const UnofficialWebviewScreen({Key? key}) : super(key: key);
Expand All @@ -30,24 +31,23 @@ class UnofficialWebviewScreen extends StatefulWidget {
}

class _UnofficialWebviewScreenState extends State<UnofficialWebviewScreen> {
final List<ContentBlocker> contentBlockers = [];

@override
void initState() {
super.initState();
}

@override
Widget build(BuildContext context) {
String championship = Hive.box('settings')
.get('championship', defaultValue: 'Formula 1') as String;
return InAppWebView(
initialUrlRequest: URLRequest(
url: WebUri(
"https://f1-dash.com/dashboard",
championship == 'Formula 1'
? 'https://f1-dash.com/dashboard'
: 'https://livetiming-formula-e.alkamelsystems.com/fiaformulae',
),
),
initialSettings: InAppWebViewSettings(
contentBlockers: contentBlockers,
),
gestureRecognizers: {
Factory<VerticalDragGestureRecognizer>(
() => VerticalDragGestureRecognizer(),
Expand Down
Loading

0 comments on commit 68dbadb

Please sign in to comment.