gamification_wheel 0.1.4
gamification_wheel: ^0.1.4 copied to clipboard
A fully customizable gamification wheel Flutter widget with Clean Architecture and BLoC pattern. Perfect for games, decision-making, and interactive applications.
gamification_wheel #
A fully customizable, animated spinning wheel widget for Flutter. Perfect for games, rewards, decision-making, and interactive apps. Not for gambling or betting purposes.
Features #
- ๐ฏ Customizable segments (text, color, probability)
- ๐จ Modern Material 3 UI
- โก Smooth, high-performance animations
- ๐ Weighted probability (fair, customizable spins)
- ๐ผ๏ธ Custom pointer and center widget
- ๐ฑ Responsive (mobile, web, desktop)
- ๐ ๏ธ Easy integration, no external state management required
- ๐ Null safety and up-to-date Flutter support
Demo #

Installation #
Add to your pubspec.yaml:
dependencies:
gamification_wheel: ^0.1.4
Then run:
flutter pub get
Quick Usage #
import 'package:gamification_wheel/gamification_wheel.dart';
import 'package:flutter/material.dart';
final segments = [
WheelSegment(id: '1', text: 'Pizza', color: Colors.red, probability: 2.0),
WheelSegment(id: '2', text: 'Burger', color: Colors.teal, probability: 1.0),
WheelSegment(id: '3', text: 'Sushi', color: Colors.blue, probability: 1.0),
// ... more segments
];
GWheel(
segments: segments,
wheelSize: 300,
animationSpeed: 2.0,
showPointer: true,
enableTapToSpin: true,
showCenterDot: true,
showWheelShadow: true,
centerWidget: Icon(Icons.star, size: 40, color: Colors.white),
onFinish: (result) {
print('You got: ${result.text}');
},
)
More Examples #
Custom Pointer Example #
GWheel(
segments: segments,
customPointer: Icon(Icons.arrow_drop_down, size: 48, color: Colors.amber),
onFinish: (result) {
// handle result
},
)
Custom Spin Button Example #
GWheel(
segments: segments,
customSpinButton: ElevatedButton(
onPressed: () {/* spin logic */},
child: Text('Try Your Luck!'),
),
)
Customization #
- Wheel Size:
wheelSize(e.g. 200-400) - Animation Speed:
animationSpeed(0.5x to 3.0x) - Segment Colors: Now use Flutter
Colorobjects (e.g.Colors.red) - Probability: Set different weights for each segment
- Pointer & Center Widget: Fully customizable
- Styling: Shadows, borders, font styles, and more
Documentation & Changelog #
Changelog (v0.1.4) #
๐ Breaking Changes
- Color Parameters Updated: Colors are now provided as Flutter
Colorobjects instead of strings. All related functions and widget parameters have been updated accordingly.
๐งน Cleanup & Improvements
- Removed Unused Dependencies: All unnecessary dependencies have been completely removed from the project.
- Color Utils Updated: Helper functions for color (
rainbowColor,colorToHex, etc.) have been updated and moved to utils, following modern Dart/Flutter standards. - Documentation Updated: Developer and user documentation has been simplified and cleaned up to reflect these changes.
License #
MIT License. See LICENSE.
Contributing #
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
โ ๏ธ Important Notice #
This package is NOT intended for gambling, betting, or any real-money gaming purposes. It is designed for gamification, education, entertainment, and decision-making apps only.