slot_machine_roller 1.0.1 copy "slot_machine_roller: ^1.0.1" to clipboard
slot_machine_roller: ^1.0.1 copied to clipboard

The easiest way to control slot machine.

Slot Machine Roller #

The easiest way to control slot machine.
You just use setState to pass to target parameter to deterministic value to stop rolling.
Otherwise pass null to target parameter to start rolling until no null.

Here is the demo page.

Features #

  • Easy way to start/stop rolling.
  • Customized build items in roller.
  • Deterministic value to stop in anytime.
  • The rolling animation involved damping.
  • Enable rolling delay at start time.
  • With up or down rolling direction.

Getting started #

flutter pub add slot_machine_roller

Usage #

You can see example for more details.

SlotMachineRoller(
    height: 170,
    width: 300,
    delay: Duration(seconds: 1)
    reverse: true,
    target: target,
    itemBuilder: (e) => Container(
        margin: EdgeInsets.symmetric(vertical: 10),
        height: 150,
        width: 150,
        alignment: Alignment.center,
        decoration: BoxDecoration(
            shape: BoxShape.circle, color: Colors.blue),
        child: Text(
            '$e',
            style: Theme.of(context)
                .primaryTextTheme
                .headlineLarge,
        ),
    )),
// To stop roller and suspend 4
setState(){
    target = 4;
}
// To start rolling until deterministic target
setState(){
    target = null; 
}

Please Note the height of item should as equal as the height of SlotMachineRoller. Because we expect the view only one item in roller.

Additional information #

The assets images are referred from
https://github.com/josex2r/jQuery-SlotMachine.

2
likes
140
points
237
downloads

Publisher

unverified uploader

Weekly Downloads

The easiest way to control slot machine.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on slot_machine_roller