Giter Club home page Giter Club logo

wn_lock's Introduction

WN_LOCK

一款用于flutter 的N宫格锁屏,但是可以有更多的玩法。是你,那么又会有怎样的发现呢?

最新版本

dependencies:
  wn_lock: ^version

演示

例子

使用示例:
@override
  void initState() {
    super.initState();
    // controller 初始化
    _lockController = LockController();
    // 建议将listener抽出并在dispose时remove
    _lockController.addListener(_lockListener);

  }
  @override
  void dispose() {
    super.dispose();
    _lockController.removeListener(_lockListener);
  }
void _lockListener() {
    // 这里的value 的listener将会获取每次用户划过child widget的index
    // 返回值是index的数组
    print('${_lockController.value.offsets}');
}
WNLockWidget(
    lineColor: Colors.amber,
    lineWidth: 2,
    // attr: HeartAttr(color: Colors.green, width: 2),
    // attr: CircleAttr(radius: 5, color: Colors.green, width: 2),
    attr: SquareAttr(length: 5, color: Colors.amber, width: 2),
    controller: _lockController,
    width: 300,
    height: 400,
    row: 5,
    column: 5,
)

参数

属性 类型 描述 默认 必填
onPanEnd ValueChanged<List> 当手指离开时结果回调 false
controller LockController lock Controller true
row int 默认的行数 3 false
column int 默认的列数 3 false
attr Attr 绘制属性 CircleAttr(radius: 10.0) false
touchInChildScale double 可触碰体积占child比例 1 false
width double widget 宽 100 false
height double widget 高 100 false
padding EdgeInsets widget 内边距 false
margin EdgeInsets widget 外边距 false
lineWidth double 连线度宽 2 false
lineColor Color 连线颜色 Colors.lightBlueAccent false
*eachInParentScale(未来版本会实现) double child根据row平分column所占空间比 0.5 false

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.