url_launcher 5.0.2
https://pub.dartlang.org/packages/url_launcher
中文博客讲解
https://blog.csdn.net/u011272795/article/details/82786027
app内webview打开
https://github.com/search?q=flutter+webview
https://github.com/fluttercommunity/flutter_webview_plugin
https://github.com/PonnamKarthik/FlutterWebView
local-storage
https://stackoverflow.com/questions/50960945/flutter-webivew-how-to-set-local-storage
官方插件
https://juejin.im/post/5ca1da31e51d4509ea3d0540
https://pub.dev/packages/webview_flutter
外部打开的例子
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
void main() {
runApp(Scaffold(
body: Center(
child: RaisedButton(
onPressed: _launchURL,
child: Text('Show Flutter homepage'),
),
),
));
}
_launchURL() async {
const url = 'https://flutter.io';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
拨打电话
https://blog.csdn.net/weixin_30512027/article/details/82746356
_call(phoneNum) async {
var url = 'tel:$phoneNum';
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
}
页面内打开
可以带token、
https://blog.csdn.net/weixin_44345526/article/details/86905372
https://www.cnblogs.com/pjl43/p/9866753.html
import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
Widget titleSection = new MaterialApp(
initialRoute: "/",
routes: {
"/": (_) => new WebviewScaffold(
url: "https://www.cnblogs.com/pjl43/p/9866753.html",
appBar: new AppBar(
title: new Text("Anytitle"),
),
),
},
);
return titleSection;
}
}
内部打开的另一种
https://pub.dev/packages/flutter_inappbrowser
报错诶