[](()创建Flutter module
===================================================================================
既然是做混合开发,那么我们肯定是由Android原生项目的。假如native项目的路径是这样的:flutter/flutter_hybrid/native,那么我们需要在native上一层目录flutter_hybrid中创建Flutter module。
cd flutter/flutter_hybrid/
//创建支持AndroidX的flutter_module
flutter create --androidx -t module flutter_module
//创建不支持AndroidX的flutter_module
flutter create -t module flutter_module
所以我们在创建模块的时候首先要确定native项目是不是已经支持AndroidX,如果支持就需要加上 --androidx 参数。
输入后控制台打印如下:
$ flutter create -t module flutter_module
Creating project flutter_module…
flutter_module/test/widget_test.dart (created)
flutter_module/flutter_module.iml (created)
flutter_module/.gitignore (created)
flutter_module/.metadata (created)
flutter_module/pubspec.yaml (created)
flutter_module/README.md (created)
flutter_module/