flutter

运行卡在flutter packages get: running…

F5调试的时候 卡在 flutter packages get: running... 好久,看输出日志 应该是官网北墙,官方也注意到了这个问题. 提供了中国的镜像,我们只需新增系统变量 PUB_HOSTED_URL 和 FLUTTER_STORAGE_BASE_URL 两个参数,并分别设置URL 即可. PUB_HOSTED_URL=https://pub.flutter-io.cn FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn 设置完毕执行: flutter doctor   下面是linux操作办法 export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn git clone -b dev https://github.com/flutter/flutter.git export PATH=&qu...

D8: Invoke-customs are only supported starting with Android O (–min-api 26)

 在\android\app\build.gradle中添加以下内容: compileOptions { sourceCompatibility JavaVersion.VERSION_1_8     targetCompatibility JavaVersion.VERSION_1_8 } 如下: android { compileSdkVersion 27 lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.xyvod" minSdkVersion 16 targetSdkVersion 27 versionCode flutterVersionCod...

Flutter 集成 Python

  This example shows how to run python script from flutter. This example is based on starcore_for_flutter, which enables flutter calls other scripts. Step by Step 1. Create flutter project $ flutter create flutter_python 2. Add dependency package “starflut” and assets folder Edit “pubspec.yaml” dependencies: flutter: sdk: flutter starflut: any ... # To add assets to your application, add an assets section, like this: a...

flutter_webview_plugin 插件的安装与引用

flutter 引用 webview 插件步骤 1. 添加插件依赖 编辑 pubspec.yaml 文件,在dependencies:下增加一行: flutter_webview_plugin: ^0.3.0+2 例子: dependencies: flutter_webview_plugin: ^0.3.0+2 2. 安装 执行下面命令安装插件,如果是 vscode 保存文件后会自动安装 $ flutter packages get 3.引入插件 文件头部增加 import 'package:flutter_webview_plugin/flutter_webview_plugin.dart'; 参考网址: https://pub.dartlang.org/packages/flutter_webview_plugin#-installing-tab-