Flutter开发技巧ListView去除水波纹方法示例
作者:Asscre 时间:2021-12-27 14:15:24
ScrollConfiguration(
behavior: NoScrollBehaviorWidget(),
child: ListView(
......
......
),
),
调用ScrollConfiguration官方类,实现behavior
NoScrollBehaviorWidget用于去除水波纹的自定义Widget
import 'package:flutter/material.dart';
/// 去除listview水印
/// ScrollConfiguration behavior
class NoScrollBehaviorWidget extends ScrollBehavior {
@override
Widget buildViewportChrome(BuildContext context, Widget child,
AxisDirection axisDirection) {
switch (getPlatform(context)) {
case TargetPlatform.iOS:
return child;
case TargetPlatform.android:
case TargetPlatform.fuchsia:
return GlowingOverscrollIndicator(
axisDirection: axisDirection,
color: Theme
.of(context)
.accentColor,
child: child,
showTrailing: false,
showLeading: false,);
case TargetPlatform.linux:
break;
case TargetPlatform.macOS:
break;
case TargetPlatform.windows:
break;
}
return child;
}
}
来源:https://juejin.cn/post/7038414232462819341
标签:Flutter,ListView,去除,水波纹
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
C#生成EMF矢量图形文件示例详解
2022-10-30 02:12:56
![](https://img.aspxhome.com/file/2023/9/79129_0s.jpg)
详解JAVA中获取文件MD5值的四种方法
2021-07-20 22:56:15
![](https://img.aspxhome.com/file/2023/1/78221_0s.png)
java Unicode和UTF-8之间转换实例
2023-04-05 01:56:00
![](https://img.aspxhome.com/file/2023/6/70566_0s.jpg)
C# 面向对象三大特性:封装、继承、多态
2022-09-15 17:00:53
Intellij IDEA导入JAVA项目并启动(图文教程)
2021-11-05 12:30:18
![](https://img.aspxhome.com/file/2023/7/81927_0s.jpg)
Spring JPA整合QueryDSL的示例代码
2022-12-02 18:56:22
![](https://img.aspxhome.com/file/2023/1/99891_0s.png)
java常用工具类 Random随机数、MD5加密工具类
2023-02-14 17:55:08
Java并发编程之同步容器与并发容器详解
2023-10-17 04:06:23
![](https://img.aspxhome.com/file/2023/8/102648_0s.png)
Java序列化常见的三个问题
2023-11-21 08:40:52
java日期操作工具类(获取指定日期、日期转换、相隔天数)
2023-11-28 06:42:53
C# 基于udp广播收集局域网类所有设备信息
2022-04-28 00:17:23
![](https://img.aspxhome.com/file/2023/5/111215_0s.png)
Spring Security基于散列加密方案实现自动登录功能
2022-09-19 01:10:22
![](https://img.aspxhome.com/file/2023/5/86855_0s.png)
Android小知识之OkHttp的2种请求方式详解
2021-06-05 04:33:45
三道java新手入门面试题,通往自由的道路--锁+Volatile
2023-09-04 20:33:42
![](https://img.aspxhome.com/file/2023/7/68717_0s.jpg)
Android垃圾回收机制解决内存泄露问题
2021-08-29 09:20:55
![](https://img.aspxhome.com/file/2023/2/97832_0s.png)
详解Android 中的文件存储
2023-12-21 17:44:44
C#正则过滤HTML标签并保留指定标签的方法
2022-12-23 18:21:39
Java调用第三方接口示范的实现
2023-06-27 20:32:10
![](https://img.aspxhome.com/file/2023/8/67468_0s.png)
java实现多人聊天室可视化
2021-08-27 01:16:49
![](https://img.aspxhome.com/file/2023/0/79180_0s.jpg)
Java二维数组实现数字拼图效果
2021-11-21 20:39:17