feat:初始化工程
This commit is contained in:
37
lib/main.dart
Normal file
37
lib/main.dart
Normal file
@@ -0,0 +1,37 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
home: Scaffold(body: SafeArea(child: InAppWebViewExample())),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class InAppWebViewExample extends StatefulWidget {
|
||||
@override
|
||||
_InAppWebViewExampleState createState() => _InAppWebViewExampleState();
|
||||
}
|
||||
|
||||
class _InAppWebViewExampleState extends State<InAppWebViewExample> {
|
||||
InAppWebViewController? webViewController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InAppWebView(
|
||||
initialUrlRequest: URLRequest(
|
||||
url: WebUri("http://14.103.235.151/"),
|
||||
),
|
||||
onWebViewCreated: (InAppWebViewController controller) {
|
||||
webViewController = controller;
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user