当前位置:网站首页>Flutter 启动白屏
Flutter 启动白屏
2022-07-29 03:35:00 【nicepainkiller】
前言: 在原生开发中,一般会设置 开屏页;来防止 App启动时候白屏现象;在Flutter 开发中,如果是纯 Flutter 开发的话; 以Flutter 写 开屏页;也会有这个现象; 尽管 发布 release 版本 白屏现象会改善很多。但是偶尔 还是会白屏一下;
下面提供两个思路来解决这个问题!
写一个原生页面来做开屏,然后异步加载 Flutter引擎
这种方式就稍微有点麻烦了:
这里推荐使用插件:flutter_native_splashhttps://pub.flutter-io.cn/packages/flutter_native_splash
配置Flutter 启动时的颜色;(就是替换掉白色为 你启动页面颜色相同的,这样就不会白色闪一下。这种方式比较讨巧,不愿意写原生代码的 朋友们可以使用这种方式!)
首先用 androidStudio 打开你的 android 工程:
res-> values 右键 创建一个 colors.xml 文件
设置 成你需要 的颜色
<?xml version="1.0" encoding="utf-8"?> <resources> <color name="AppBackground">#1D69F9</color> </resources>把下面 两个文件中 LaunchTheme 中的标签修改为 你刚刚添加的颜色值就可以了
现在就大功完成了!你可以试试了
边栏推荐
- makefile详解
- (2022杭电多校三)1011-Link is as bear(思维+线性基)
- Notes on letter symbol marking of papers
- Photo scale correction tool: DxO viewpoint 3 direct mount version
- 2 neural network toolbox NN
- Precautions for using latex
- Sleuth+zipkin to track distributed service links
- Implement Lmax disruptor queue from scratch (VI) analysis of the principle of disruptor solving pseudo sharing and consumers' elegant stopping
- 深入C语言(3)—— C的输入输出流
- Simple use of eventbus
猜你喜欢

Photo scale correction tool: DxO viewpoint 3 direct mount version

Idea configuration web container and war packaging

I.MX6U-驱动开发-2-LED驱动

for_each用法示例

Exness: dove resolution helped gold rebound, and the focus turned to U.S. GDP

Configure vscade to realize ROS writing

Bingbing learning notes: operator overloading -- implementation of date class

Excel splicing database statement

深入C语言(1)——操作符与表达式

实例搭建Flask服务(简易版)
随机推荐
RTP 发送 和接收 h265
Shardingsphere's level table practice (III)
深入C语言(2)——结构的定义与使用
Arm architecture and neural network
最新二开版漫画小说听书三合一完整源码/整合免签接口/搭建教程/带采集接口
Sleuth+zipkin to track distributed service links
CUDA GDB prompt: /tmp/tmpxft**** cudafe1.stub. c: No such file or directory.
Practical application cases of digital Twins - smart energy
Exness: dove resolution helped gold rebound, and the focus turned to U.S. GDP
Producer consumer model of concurrent model
Redis之sentinel哨兵集群怎么部署
Naive Bayes -- continuous data
Deep into C language (3) -- input and output stream of C
Does domestic ERP have a chance to beat sap?
The difference between int and integer. Is int or integer used in practical applications?
Web uploader cannot upload multiple files
LeetCode 1331 数组序号转换[Map] HERODING的LeetCode之路
Summary of basic knowledge points of C language
Machine learning [numpy]
How to solve the time zone problem in MySQL timestamp

