xumaohuai/Flutter-CuriosityApp
Flutter高仿好奇心日报
- Stars
- 786
- Forks
- 139
- Last push (UTC)
- Jan 8, 2019
- Project status
- Active
Dependencies used
Dependency list 10 items
- flutter
{"sdk":"flutter"} - flutter_webview_plugin
^0.3.0+2 - json_annotation
^2.0.0 - dio
^1.0.13 - cupertino_icons
^0.1.2 - flutter_spinkit
^3.1.0 - flutter_swiper
^1.1.4 - flutter_testDevelopment
{"sdk":"flutter"} - json_serializableDevelopment
^2.0.1 - build_runnerDevelopment
^1.1.2
Rankings
Original README
English project snapshot. Visit GitHub for the latest content.
Expand / collapse project README
欢迎Star
基于Flutter开发,适配Android与iOS。 项目同时适合Flutter的练手学习,覆盖了基本框架的使用,与原生的交互等。
注意事项
1.下载项目后报错是因为没有添加依赖,在pubspec.yaml文件中点击Packages get下载依赖,有时候会在这里出现卡死的情况,可以配置一下环境变量.在终端执行
vi ~/.bash_profile,再添加export PUB_HOSTED_URL=https://pub.flutter-io.cn和export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn.详情请看修改Flutter环境变量.
2.需要将File Encodings里的
Project Encoding设置为UTF-8,否则有时候安卓会报错
3.如果cocoapods不是最新可能会出现
Error Running Pod Install,请更新cocoapods.
4.由于flutter_webview_plugin这个插件只支持加载url,于是就需要做一些修改.
- iOS 在
FlutterWebviewPlugin.m文件中的- (void)navigate:(FlutterMethodCall*)call方法中的最后一排,将[self.webview loadRequest:request]方法改为[self.webview loadHTMLString:url baseURL:nil]- Android 在
WebViewManager.java文件中webView.loadUrl(url)方法改为webView.loadData(url, "text/html; charset=UTF-8", null);,以及下面那排的void reloadUrl(String url) { webView.loadUrl(url); }改为void reloadUrl(String url) { webView.loadData(url, "text/html; charset=UTF-8", null); }
相关文章
Flutter实战详解--高仿好奇心日报
示例图片
iOS效果图.gif Android效果图.gif
https://upload-images.jianshu.io/upload_images/1220329-6213761c70c25366.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 https://upload-images.jianshu.io/upload_images/1220329-250c5c7b013e66b2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 https://upload-images.jianshu.io/upload_images/1220329-131273bb45b1b79d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 https://upload-images.jianshu.io/upload_images/1220329-712799e7e1f86f45.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 https://upload-images.jianshu.io/upload_images/1220329-587d0c87efcfdf3e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 https://upload-images.jianshu.io/upload_images/1220329-138e45f5633e2d5c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240 https://upload-images.jianshu.io/upload_images/1220329-53cae7d88c690973.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240