roulette_widget 1.4.0 copy "roulette_widget: ^1.4.0" to clipboard
roulette_widget: ^1.4.0 copied to clipboard

A simple customizable roulette widget that you only have to pass the options to be showed.

example/main.dart

import 'package:flutter/material.dart';

import 'package:roulette_widget/roulette_widget.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    const double heightIndicator = 30;
    const double widthIndicator = 30;
    const double widthRoulette = 200;
    otherActions() {
      // ignore: avoid_print
      print('Hello World');
    }

    return MaterialApp(
      title: 'Material App',
      home: Scaffold(
        body: SafeArea(
          child: Padding(
            padding: const EdgeInsets.all(10.0),
            child: Column(
              children: [
                RouletteWidget(
                  widthRoulette: widthRoulette,
                  widthIndicator: widthIndicator,
                  heightIndicator: heightIndicator,
                  options: [
                    RouletteElementModel(text: 'Option 1', color: Colors.red),
                    RouletteElementModel(text: 'Option 2', color: Colors.blue),
                    RouletteElementModel(
                        text: 'Option 3', color: Colors.orange),
                    RouletteElementModel(text: 'Option 4', color: Colors.green),
                    RouletteElementModel(
                        text: 'Option 5', color: Colors.yellow),
                  ],
                  otherActions: otherActions,
                  borderWidth: 20,
                  borderColor: Colors.black,
                  centralWidget: const Icon(Icons.tips_and_updates_rounded),
                  widthCentralWidget: 100,
                  heightCentralWidget: 100,
                ),
                const Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Icon(
                      Icons.info,
                      color: Colors.blueAccent,
                    ),
                    Text(
                      'Tap or Drag to Spin',
                      style: TextStyle(
                          fontWeight: FontWeight.w500,
                          color: Colors.blueAccent),
                    ),
                  ],
                )
              ],
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
5
downloads

Publisher

unverified uploader

Weekly Downloads

A simple customizable roulette widget that you only have to pass the options to be showed.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

animate_do, flutter

More

Packages that depend on roulette_widget