这里java说的是flutter_native_splash插件,非原生

1. pubspec.yaml添加插件

dependencies:
  flutter_native_splash: ^2.4.6
  
#启动样式
flutter_native_splash:
  color: "#FF0000"
  image: assets/images/test.png

2.终端pub get

3.执行插件代码植入指令

flutter pub run flutter_native_splash:create

image.png

看到对勾就算完成了。

4. 清除,运行

flutter clean
flutter run

5. 此时此刻的启动界面:

image.png

低版本以及杂交flutter环境的坑:

不出意外就是出意外了,等不到到 5 的出现

最多见到这种:

image.png

解决方法:

image.png

最后:pub run