Git Product home page Git Product logo

left-scroll-actions's Introduction

left_scroll_actions

A useful left scroll actions widget like WeChat.

一款仿微信效果的 Flutter 左滑菜单插件。现在支持iOS的展开与弹性效果。

很轻松的打开关闭指定组件。 或者在同一个列表内通过tag实现联动关闭(打开一个关闭其他)。

preview

Install

Add this to your package's pubspec.yaml file: 把如下字段加入你的pubspec.yaml文件:

dependencies:
  flutter:
    sdk: flutter
  // 添加下面这一行。 Add this row.
  left_scroll_actions: any

然后运行flutter packages get即可

Usage

CupertinoLeftScroll (1.4.0)

  CupertinoLeftScroll(
    // important, each Row must have different key.
    // DO NOT use '$index' as Key! Use id or title.
    key: Key('TODO: your key'),
    // left scroll widget will auto close while the other widget is opened and has same closeTag.
    // 当另一个有相同closeTag的组件打开时,其他有着相同closeTag的组件会自动关闭.
    closeTag: LeftScrollCloseTag('TODO: your tag'),
    buttonWidth: 80,
    child: Container(
      height: 60,
      color: Colors.white,
      alignment: Alignment.center,
      child: Text('👈 Try Scroll Left'),
    ),
    buttons: <Widget>[
      LeftScrollItem(
        text: 'edit',
        color: Colors.orange,
        onTap: () {
          print('edit');
        },
      ),
      LeftScrollItem(
        text: 'delete',
        color: Colors.red,
        onTap: () {
          print('delete');
        },
      ),
    ],
    onTap: () {
      print('tap row');
    },
  );

LeftScroll

You can use this widget as same as CupertinoLeftScroll. Custom define you slide animation by implements onScroll function.

弹性 (1.5.0)

  1. 设置CupertinoLeftScrollbounce参数为true,即可获得弹性效果
  2. 通过CupertinoLeftScrollbounceStyle参数控制弹性效果

左滑联动列表(1.3.0)

  1. 对于提供同一个LeftScrollCloseTag的LeftScroll组件,可以在一个打开时,关闭其他组件
  2. 想要关闭特定的行,只需使用以下代码
// 找到对应tag与key的row状态,改变状态即可
LeftScrollGlobalListener.instance.targetStatus(tag,key).value = false;

左滑列表(1.2.0新增)(已过期)

/// 已过期
LeftScrollList.builder(
  /// Deprecated! Do not use this widget anymore.
  /// Instead, you can add [LeftScrollCloseTag] property to [LeftScroll] or [CupertinoLeftScroll] widget.
);

See:

Getting Started

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.