Giter Club home page Giter Club logo

flutter-grid-lottery's Introduction

Anurag's GitHub stats Top Langs

flutter-grid-lottery's People

Contributors

jdchi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter-grid-lottery's Issues

抽奖动画处理

你好,我现在有新的需求。我现在抽奖界面是7x8的方格,现在是想让抽奖的动画是从上次中奖的位置开始,然后根据移动的步数计算新的中奖位置
` Animation _initSelectIndexTween(
{int begin = 0, int end = 0, Curve curve = Curves.linear}) =>
StepTween(begin: StorageManager.getDiceTarget(), end: end).animate(
CurvedAnimation(parent: _startAnimateController, curve: curve));

_startActualAnimation() {
// _selectedIndexTween = _initSelectIndexTween(
// end: widget.controller.value.repeatRound * _totalIndex +
// widget.controller.value.target,
// curve: Curves.easeOutCubic);
int end = widget.controller.value.target % _totalIndex;
print('真的抽奖动画目标=='+ end.toString());
_selectedIndexTween = _initSelectIndexTween(end: end,curve: Curves.easeOutCubic);
_startAnimateController
..reset()
..duration = widget.controller.value.duration
..forward();
}`
其中_totalIndex = 26;repeatRound = 0;
StepTween(begin: StorageManager.getDiceTarget(), end: end),begin 是本地存储上次中奖的位置。end 是计算的新的中奖位置。从0 到25的动画是正常顺时针转的,但是从25到1的动画却是逆时针转的。就是在转满一圈的时候不知道要怎么处理。
https://github.com/cw0925/Flutter-Grid-Lottery.git,可以看下这个

抽奖后重置奖项

你好,想问下重置奖项要怎么做。就是抽完奖后,抽奖界面九宫格的内容要改变。

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.