打印/下载
参数
纵向
横向

参数

  • slotHtml: (List) 滑动内容
  • scrollX: (bool) x轴方向滑动, 默认: false
  • upper: (double) "顶部/左边"区域大小, 默认: 64
  • lowerBoundary: (double) "底部/右边"触发 up/right 事件, 默认: 50
  • upperLoad: (bool) "顶部/左边"加载动画, 默认: true
  • upperIcon: (IconData) "顶部/左边"加载图标, 默认: 'ui ui_loading'
  • upperBg: (String) "顶部/左边"背景颜色, 默认: ''
  • upperColor: (String) "顶部/左边"字体图标颜色, 默认: ''
  • limit: (double) 滑动距离触发swipe, 默认: 120
  • bgColor: (String) 滑动区域背景颜色, 默认: '#F2F4F6'

事件

  • scroll: (Function) 滚动时触发, 返回: {位置信息}
  • up: (Function) 上拉时触发, 返回: {位置信息}
  • down: (Function) 下拉时触发, 返回: {位置信息}
  • left: (Function) 左拉时触发, 返回: {位置信息}
  • right: (Function) 右拉时触发, 返回: {位置信息}
  • swipe: (Function) 滑动方向, 返回: 'left' | 'right' | 'up' | 'down'

Y轴方向

import 'package:flutter/material.dart';
import 'package:webmis/components/scroll-view.dart';

class Demo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => DemoState();
}
class DemoState extends State<Demo> {

  /* Widget */
  @override
  Widget build(BuildContext context) {
    /* 显示 */
    return Scaffold(
      body: WmScrollView(
        // scroll: (res)=> print('滑动: ${res}'),
        down: (res)=> print('下拉: ${res}'),
        up: (res)=> print('上拉: ${res}'),
        swipe: (res)=> print('方向: ${res}'),
        slotHtml: [
          Container(
            height: 500,
            color: Colors.red,
            child: Text('1'),
          ),
          Container(
            height: 500,
            color: Colors.green,
            child: Text('2'),
          ),
          Container(
            height: 500,
            color: Colors.blue,
            child: Text('3'),
          ),
        ],
      ),
    );
  }

}

X轴方向

import 'package:flutter/material.dart';
import 'package:webmis/components/scroll-view.dart';

class Demo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => DemoState();
}
class DemoState extends State<Demo> {

  /* Widget */
  @override
  Widget build(BuildContext context) {
    /* 显示 */
    return Scaffold(
      body: WmScrollView(
        scrollX: true,
        // scroll: (res)=> print('滑动: ${res}'),
        left: (res)=> print('左拉: ${res}'),
        right: (res)=> print('右拉: ${res}'),
        swipe: (res)=> print('上拉: ${res}'),
        slotHtml:[
          Container(
            width: 300,
            color: Colors.red,
            child: Text('1'),
          ),
          Container(
            width: 300,
            color: Colors.green,
            child: Text('2'),
          ),
          Container(
            width: 300,
            color: Colors.blue,
            child: Text('3'),
          ),
        ],
      ),
    );
  }

}
{{copy}}