开发者

Flutter开发技巧ListView去除水波纹方法示例

开发者 https://www.devze.com 2022-12-10 10:22 出处:网络 作者: Asscre
目录正文正文 ScrollConfiguration( behavior: NoScrollBehaviorWidget(), child: ListView( ...... ...编程客栈...
目录
  • 正文

正文

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(
          axisDirectio开发者_C学习n: axisDirection,
          color: Theme
              .of(context)
              .accentColor,
          child: child,
          showTrailing: false,
          showLeading: false,php);
      case TargetPlatform.linux:
        break;
      case TargetPlatform.MACOS:
        break;
      case TargpythonetPlatform.Windows:
  编程客栈      break;
    }
    return child;
  }
}

以上就是Flutter开发技巧ListView去除水python波纹方法示例的详细内容,更多关于Flutter ListView去除水波纹的资料请关注我们其它相关文章!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号