[英]Why doesn't my flutter_native_splash work?
When I launch the app, the background color works, but the image doesn't show.当我启动该应用程序时,背景颜色有效,但图像不显示。 I have my assets folder in my root directory, and the directory address is matched correctly, but the error persists.我的根目录下有我的assets文件夹,目录地址匹配正确,但错误依旧。
I followed these steps and have this as my pubspec.yaml:我遵循了这些步骤并将其作为我的 pubspec.yaml:
flutter_native_splash:
color: "#000000"
image: assets/icon_500.png
here is my code that runs这是我运行的代码
void main() {
WidgetsBinding widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);
WidgetsFlutterBinding.ensureInitialized();
runApp(const Main());
FlutterNativeSplash.remove();
}
I ran these terminal commands:我运行了这些终端命令:
flutter clean
flutter pub get
flutter pub run flutter_native_splash:remove
flutter clean
flutter pub get
flutter pub run flutter_native_splash:create
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.