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

外部打开的例子

  1. import 'package:flutter/material.dart';
  2. import 'package:url_launcher/url_launcher.dart';
  3. void main() {
  4. runApp(Scaffold(
  5. body: Center(
  6. child: RaisedButton(
  7. onPressed: _launchURL,
  8. child: Text('Show Flutter homepage'),
  9. ),
  10. ),
  11. ));
  12. }
  13. _launchURL() async {
  14. const url = 'https://flutter.io';
  15. if (await canLaunch(url)) {
  16. await launch(url);
  17. } else {
  18. throw 'Could not launch $url';
  19. }
  20. }

拨打电话

https://blog.csdn.net/weixin_30512027/article/details/82746356

  1. _call(phoneNum) async {
  2. var url = 'tel:$phoneNum';
  3. if (await canLaunch(url)) {
  4. await launch(url);
  5. } else {
  6. throw 'Could not launch $url';
  7. }
  8. }

页面内打开

可以带token、
https://blog.csdn.net/weixin_44345526/article/details/86905372
https://www.cnblogs.com/pjl43/p/9866753.html

  1. import 'package:flutter/material.dart';
  2. import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
  3. void main() => runApp(MyApp());
  4. class MyApp extends StatelessWidget {
  5. @override
  6. Widget build(BuildContext context) {
  7. Widget titleSection = new MaterialApp(
  8. initialRoute: "/",
  9. routes: {
  10. "/": (_) => new WebviewScaffold(
  11. url: "https://www.cnblogs.com/pjl43/p/9866753.html",
  12. appBar: new AppBar(
  13. title: new Text("Anytitle"),
  14. ),
  15. ),
  16. },
  17. );
  18. return titleSection;
  19. }
  20. }

内部打开的另一种

https://pub.dev/packages/flutter_inappbrowser

  1. 报错诶

打电话报错 Could not launch “xxx”

https://www.jianshu.com/p/67dfc253fbba