flutter 我怎样才能去掉在启动画面之前出现的白屏和黑屏?

watbbzwu  于 2022-11-30  发布在  Flutter
关注(0)|答案(2)|浏览(179)

当我打开应用程序时,白色屏幕出现图标。然后只出现启动画面。我已经试过改变背景颜色了。

blmhpbnm

blmhpbnm1#

Flutter闪屏建立在iOS故事板和Android Activity之上您需要编辑这些文件才能继续

uemypmqf

uemypmqf2#

你可以使用flutter_native_splash软件包。你可以阅读设置闪屏部分了解详细信息。你需要覆盖

flutter_native_splash:
  # This package generates native code to customize Flutter's default white native splash screen
  # with background color and splash image.
  # Customize the parameters below, and run the following command in the terminal:
  # flutter pub run flutter_native_splash:create
  # To restore Flutter's default white splash screen, run the following command in the terminal:
  # flutter pub run flutter_native_splash:remove

  # color or background_image is the only required parameter.  Use color to set the background
  # of your splash screen to a solid color.  Use background_image to set the background of your
  # splash screen to a png image.  This is useful for gradients. The image will be stretch to the
  # size of the app. Only one parameter can be used, color and background_image cannot both be set.
  color: "#42a5f5" #here the color

然后跟着跑包

flutter pub run flutter_native_splash:create

相关问题