SliverAppBar(Flutter)中的渐变? [英] Gradient in SliverAppBar (Flutter)?
本文介绍了SliverAppBar(Flutter)中的渐变?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人在SliverAppBar
中使用过Gradient
吗?展开后,我可以在FlexibleSpace
中执行此操作,但是折叠时,它会变为纯色.有可能治疗吗?
Has anyone used Gradient
in SliverAppBar
? I can do it in FlexibleSpace
when it's expanded, but when it's collapsed it gets a solid color. Is it possible to treat this?
推荐答案
在FlexibleSpaceBar中包装一个新的Container Widget,然后在该容器下添加BoxDecoration,LinearGradient.
Wrap a new Container Widget in FlexibleSpaceBar, then add BoxDecoration, LinearGradient under the container.
这篇关于SliverAppBar(Flutter)中的渐变?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文