slot_machine_ui 0.1.2 copy "slot_machine_ui: ^0.1.2" to clipboard
slot_machine_ui: ^0.1.2 copied to clipboard

A highly customizable slot machine widget for Flutter with smooth animations, beautiful skeuomorphic design, and sound support.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:slot_machine_ui/slot_machine_ui.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Slot Machine Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final SlotMachineController _controller = SlotMachineController();

  final List<String> _symbols = [
    '🍒',
    '🍋',
    '7️⃣',
    '💎',
    '⭐',
    '🔔',
  ];

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: SlotMachineWidget(
          primaryColor: Colors.redAccent,
          showInnerFrame: true,
          width: 300,
          controller: _controller,
          symbols: _symbols,
          onSpinStart: () {
            debugPrint('Spin started');
          },
          onResult: (results) {
            debugPrint('Spin result: $results');
          },
          onSpinEnd: () {
            debugPrint('Spin ended');
          },
        ),
      ),
    );
  }
}
0
likes
145
points
39
downloads

Documentation

API reference

Publisher

verified publisherkabyachalise.com.np

Weekly Downloads

A highly customizable slot machine widget for Flutter with smooth animations, beautiful skeuomorphic design, and sound support.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on slot_machine_ui