简体   繁体   English

如何使用 Flutter_native_splash 在初始屏幕底部添加文本

[英]How to add text at bottom in splash screen using Flutter_native_splash

I'm new to FLutter.我是 FLutter 的新手。 how to add text at bottom in splash screen using Flutter_native_splash?如何使用 Flutter_native_splash 在初始屏幕底部添加文本? is there a way?有办法吗?

this this my code:这是我的代码:

flutter_native_splash:
  background_image: "assets/splashscreen_background.png"
  image: assets/images/logo-text.png

the owner said: link楼主说: 链接

There is not a way to add dynamic text.没有办法添加动态文本。 If you want static text, you can add it to the splash image.如果您想要 static 文本,您可以将其添加到启动图像中。

another workaroud is, make your custom splash screen with statefull/stateless widget.另一个解决方法是,使用有状态/无状态小部件制作您的自定义闪屏。 In common case, if you only use custom widget as a splash screen, there will be a white screen before the flutter initiated.通常情况下,如果您只使用自定义小部件作为启动屏幕,则在 flutter 启动之前会出现白屏。 Therefore better use native splash to avoid that.因此最好使用原生飞溅来避免这种情况。

after the flutter has initiated, remove the native splash and display your custom splash widget. flutter 启动后,删除本机启动画面并显示您的自定义启动画面小部件。

You could add text as an image with the package's branding option.您可以使用包的branding选项将文本添加为图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM