feat: get cards from backend
This commit is contained in:
@@ -19,6 +19,8 @@ class ProfileModel {
|
||||
xpInto: (wallet['xp_into_level'] ?? 0) as int,
|
||||
xpNext: (wallet['xp_for_next'] ?? 1) as int,
|
||||
vip: (stats['vip'] ?? false) as bool,
|
||||
rankPoints: (wallet['rank_points'] ?? 0) as int,
|
||||
rankTier: (wallet['rank_tier'] ?? 'bronze') as String,
|
||||
stats: s == null
|
||||
? null
|
||||
: ProfileStats(
|
||||
|
||||
@@ -28,6 +28,8 @@ class ProfileEntity {
|
||||
final int xpInto;
|
||||
final int xpNext;
|
||||
final bool vip;
|
||||
final int rankPoints;
|
||||
final String rankTier; // bronze..king
|
||||
final ProfileStats? stats; // null یعنی قفل (غیر VIP)
|
||||
|
||||
const ProfileEntity({
|
||||
@@ -39,6 +41,8 @@ class ProfileEntity {
|
||||
required this.xpInto,
|
||||
required this.xpNext,
|
||||
required this.vip,
|
||||
required this.rankPoints,
|
||||
required this.rankTier,
|
||||
required this.stats,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:random_avatar/random_avatar.dart';
|
||||
|
||||
import '../../../../core/theme/app_theme.dart';
|
||||
import '../../../../core/widgets/game_ui.dart';
|
||||
import '../../../../core/widgets/rank_badge.dart';
|
||||
import '../../../wallet/presentation/bloc/wallet_bloc.dart';
|
||||
import '../../../wallet/presentation/bloc/wallet_event.dart';
|
||||
import '../../domain/entities/profile_entity.dart';
|
||||
@@ -146,6 +147,8 @@ class ProfileScreen extends StatelessWidget {
|
||||
if (d.vip) ...[const SizedBox(width: 8), const _VipBadge()],
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
RankBadge(tier: d.rankTier, points: d.rankPoints),
|
||||
if (d.mobile.isNotEmpty)
|
||||
Text(
|
||||
d.mobile,
|
||||
|
||||
Reference in New Issue
Block a user