flutter - Flutter:滚动到应用程序页面顶部时如何放大图像?
问题描述
我有一个页面,顶部有一个图像,下面有一些其他小部件。整个页面是可滚动的。有谁知道如何在滚动到顶部时放大图像以创建类似于 Apple Music 中的效果?
在这里,您可以找到我正在尝试创建的示例:
解决方案
尝试使用银
final bannerHigh = 150.0;
return Scaffold(
body: CustomScrollView(
slivers: <Widget>[
SliverAppBar(
backgroundColor: Color(0xFF0084C9),
leading: IconButton(
icon: Icon(
Icons.blur_on,
color: Colors.white70,
),
onPressed: () {
Scaffold.of(context).openDrawer();
},
),
expandedHeight: bannerHigh,
floating: true,
pinned: true,
flexibleSpace: FlexibleSpaceBar(
title: Text("Your title",
style: TextStyle(
fontSize: 18,
color: Colors.white,
fontWeight: FontWeight.w600)),
background: Image.network(
'image url',
fit: BoxFit.cover,
),
),
),
SliverList(
delegate: SliverChildListDelegate(
<Widget>[
],
),
),
],
),
);
推荐阅读
- docker - 从 Jenkins 容器内调用 docker stack deploy 在 docker 主机上
- java - 输入之间的空间不会对数组索引产生异常?
- javascript - 为什么在 azure Webjob(Nodejs)中触发了异步令牌功能错误,但在本地却没有?
- javascript - 如何从商店获取数据以按字段过滤。extjs
- html-framework-7 - Framework7 v3 - 如何触发标签显示
- python - Numpy:多次重塑使对象不相等
- php - 基于 PHP 中的特定字符串创建数组
- sql-server - 如何将整数转换为小数以及 SQL 中此转换的正确语法
- java-8 - 对象消息上的 JMS 消息选择器
- javascript - 使用 ajax 传递输入名称