当前位置:网站首页>解决Flutter中ThemeData.primaryColor在AppBar等组件中不生效
解决Flutter中ThemeData.primaryColor在AppBar等组件中不生效
2022-04-22 03:36:00 【旺仔大牛】
出现场景
闲着没事,将Flutter SDK升级到了2.10.5,结果发现app所有页面的AppBar颜色全变成了默认的蓝色,在MaterialApp中设置的primaryColor颜色没有生效。
MaterialApp(
theme: ThemeData(
primaryColor: const Color(0xFF009AA6),
),
)
解决方法
通过Flutter的github isseus发现,从Flutter 2.5开始,Flutter团队开始慢慢移除ThemeData.primaryColor属性对所有组件的影响,取而代之的是基于ColorScheme的Color。
MaterialApp(
theme: ThemeData(
primaryColor: const Color(0xFF009AA6),
colorScheme: ColorScheme.light().copyWith(primary: const Color(0xFF009AA6)),
),
)
版权声明
本文为[旺仔大牛]所创,转载请带上原文链接,感谢
https://blog.csdn.net/adojayfan/article/details/124327116
边栏推荐
- 隊列使用問題總結 queue:work和queue:listen的區別
- C language daily question -- [noip2008] ISBN number (question 76 of niuke.com)
- CentOS uninstall MySQL
- L'utilisation de la file d'attente résume les différences entre la file d'attente: travail et la file d'attente: Listen
- Deep learning and image recognition: principle and practice notes day_ 18 (target detection)
- Use js to obtain web page data and format it for output (web page crawling)
- MongoDB——聚合管道之$match操作
- GPU深度学习环境配置
- leetcode:297. Serialization and deserialization of binary tree
- Full summary of 18 tax categories of tax law with memory tips
猜你喜欢

吉他乐理整理

吉他樂理整理

Jupyter code cannot be run

MongoDB——聚合管道之$project操作
![[server data recovery] a data recovery case in which multiple hard disks of server raid6 are offline successively](/img/4c/5fe2e4ca3596c8df86e2e08f4bfbac.jpg)
[server data recovery] a data recovery case in which multiple hard disks of server raid6 are offline successively

使用supervisor管理laravel队列 - 配置文件supervisord.conf

Memory distribution of stm32

The third year after the epidemic: technical management and teamwork under the changing times!

Deep learning and image recognition: principle and practice notes day_ ten

Pycharm jumps to the specified line
随机推荐
吉他乐理整理
Learning neural network drawing Matplotlib
Lesson 122 of serial 5 of Rasa dialogue robot: the actual operation of Rasa dialogue robot debugging project -- the whole life cycle debugging practice of bank financial dialogue robot - (I)
Laravel is an easy-to-use code prompt tool, laravel ide helper
CentOS offline installation of MySQL
Restoring MySQL database based on data folder
The wangeditor rich text editor uses and converts the content of the editor to JSON format
"Select command denied to user 'nature' @ '192.168.1.49' for table 'user_variables_by_thread" is solved in MySQL‘“
Oracle instance management
Ink back words -- extract all its offline words through the installation package
Set iFLYTEK x Yunnan flying: a tiktok solution to solve the problem of converting passengers to achieve real-time response to private letter reply!
Redis database cluster (master-slave replication, sentinel, cluster)
GPU deep learning environment configuration
吉他樂理整理
Copy the content of Baidu Library by releasing the monitoring through the browser console
L'utilisation de la file d'attente résume les différences entre la file d'attente: travail et la file d'attente: Listen
Unittest unit test (I)
机器学习理论之(6):由逻辑回归(对数几率)方法到 SVM;为什么 SVM 是最大间隔分类器
xampp配置xdebug扩展,PHP7.2.2版本
Memory distribution of stm32