准备工作
1.创建native工程
app->build.gradle
android {
  //...
  compileOptions {
    sourceCompatibility 1.8
    targetCompatibility 1.8
  }
}
2.创建flutter工程
cd some/path/
 flutter create -t module --org com.example my_flutter
1.引入
1.1源码引入
app->settings.gradle
setBinding(new Binding([gradle: this]))                                // new
evaluate(new File(                                                     // new
  settingsDir.parentFile,                                              // new
  'my_flutter/.android/include_flutter.groovy'                         // new
)) 
app
dependencies {
  implementation project(':flutter')
}
1.2aar引入
build aar
cd some/path/my_flutter
 flutter build aar

image.png
体积分析截图

image.png