zeba_academy_badges
A production-ready Flutter package for building gamified learning experiences with:
- ā XP System
- šÆ Levels
- š Achievement Badges
- š Leaderboards
- š Rewards
Perfect for:
- Learning Apps
- LMS Platforms
- Course Platforms
- Gamification Systems
- Education Dashboards
- Student Progress Tracking
Features
ā XP Progress Tracking ā Automatic Level Calculation ā Achievement Badge Unlocking ā Reward Claim System ā Leaderboards ā Lightweight Architecture ā Fully Customizable Widgets ā Package Ready for pub.dev
Installation
Add dependency:
dependencies:
zeba_academy_badges: ^1.0.0
Install:
flutter pub get
Import
import 'package:zeba_academy_badges/zeba_academy_badges.dart';
Quick Start
final controller =
BadgesController();
await controller.addXP(
250,
);
Display:
XPCard(
xp: controller.xp,
level: controller.level,
)
Package Structure
lib/
ā
āāā src/
ā āāā badge.dart
ā āāā level.dart
ā āāā reward.dart
ā āāā leaderboard_user.dart
ā āāā xp_record.dart
ā ā
ā āāā xp_service.dart
ā āāā badge_service.dart
ā āāā reward_service.dart
ā āāā leaderboard_service.dart
ā ā
ā āāā badges_controller.dart
ā ā
ā āāā xp_card.dart
ā āāā badge_grid.dart
ā āāā reward_card.dart
ā āāā leaderboard_widget.dart
ā
āāā zeba_academy_badges.dart
XP System
Add experience points:
controller.addXP(
120,
);
Read values:
controller.xp
controller.level
Levels
Example:
Level 1 ā 0 XP
Level 2 ā 500 XP
Level 3 ā 1000 XP
Level 4 ā 1500 XP
Achievement Badges
Create badges:
final badges = [
Badge(
id: '1',
title: 'Starter',
icon: 'ā',
requiredXP: 100,
),
Badge(
id: '2',
title: 'Champion',
icon: 'š',
requiredXP: 1000,
),
];
Render:
BadgeGrid(
badges: badges,
)
Leaderboards
LeaderboardWidget(
users: users,
)
Example:
final users = [
LeaderboardUser(
name: 'Alex',
xp: 2500,
),
LeaderboardUser(
name: 'Sarah',
xp: 1700,
),
];
Rewards
Reward(
title: 'Premium Course',
cost: 500,
)
Redeem:
RewardService()
.redeem(
reward,
xp,
);
Example
import 'package:flutter/material.dart';
import 'package:zeba_academy_badges/zeba_academy_badges.dart';
void main() {
runApp(
const MyApp(),
);
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(
BuildContext context,
) {
final controller =
BadgesController();
controller.addXP(
800,
);
return MaterialApp(
home: Scaffold(
body: XPCard(
xp: controller.xp,
level: controller.level,
),
),
);
}
}
Testing
Run tests:
flutter test
Analyze:
flutter analyze
Publish check:
flutter pub publish --dry-run
Roadmap
v1.0
- XP
- Levels
- Badges
v1.1
- Rewards
v1.2
- Cloud Leaderboards
v2.0
- Firebase Sync
- Analytics
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
See the LICENSE file for details.
About Me
⨠Iām Sufyan bin Uzayr, an open-source developer passionate about building and sharing meaningful projects.
You can learn more about me and my work at:
š https://sufyanism.com š¼ https://www.linkedin.com/in/sufyanism
Your all-in-one learning hub!
š Explore courses and resources in coding, tech, and development at zeba.academy and code.zeba.academy.
Empower yourself with practical skills through curated tutorials, real-world projects, and hands-on experience.
Level up your tech game today! š»āØ
Zeba Academy is a learning platform dedicated to:
- Coding
- Technology
- Development
ā” Main Site: https://zeba.academy ā” Courses: https://code.zeba.academy ā” YouTube: https://www.youtube.com/@zeba.academy ā” Instagram: https://www.instagram.com/zeba.academy/
Thank you for visiting ā¤ļø