-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chores and cleaning up after Flutter 3.7 (#838)
* print info when packageName/bundleId is unknown * migrate example app to webview v4.0.0
- Loading branch information
1 parent
cc88f3c
commit 4783749
Showing
7 changed files
with
267 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,32 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:webview_flutter/webview_flutter.dart'; | ||
|
||
class WebViewScreen extends StatelessWidget { | ||
class WebViewScreen extends StatefulWidget { | ||
const WebViewScreen({super.key, required this.title, required this.url}); | ||
|
||
final String title; | ||
final String url; | ||
|
||
@override | ||
State<WebViewScreen> createState() => _WebViewScreenState(); | ||
} | ||
|
||
class _WebViewScreenState extends State<WebViewScreen> { | ||
late final WebViewController controller; | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
controller = WebViewController() | ||
..setJavaScriptMode(JavaScriptMode.unrestricted) | ||
..loadRequest(Uri.parse(widget.url)); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar(title: Text(title)), | ||
body: WebView( | ||
debuggingEnabled: true, | ||
initialUrl: url, | ||
javascriptMode: JavascriptMode.unrestricted, | ||
onWebViewCreated: (controller) => print('WebView created for $url'), | ||
onPageFinished: (url) => print('WebView finished loading for $url'), | ||
), | ||
appBar: AppBar(title: Text(widget.title)), | ||
body: WebViewWidget(controller: controller), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
packages/patrol_cli/lib/src/common/extensions/stopwatch.dart
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.