feat: add characters

This commit is contained in:
2026-07-10 00:56:58 +03:30
parent 7c067d36f2
commit 97d156c492
28 changed files with 486 additions and 94 deletions
@@ -13,6 +13,7 @@ class ProfileModel {
return ProfileEntity(
name: (name == null || name.isEmpty) ? 'بازیکن' : name,
avatar: (avatar == null || avatar.isEmpty) ? 'hakem-1' : avatar,
avatarImg: (wallet['selected_avatar_img'] ?? '') as String,
mobile: (user['mobile'] as String?) ?? '',
level: (wallet['level'] ?? 1) as int,
trophies: (wallet['trophies'] ?? 0) as int,
@@ -22,6 +22,7 @@ class ProfileStats {
class ProfileEntity {
final String name;
final String avatar;
final String avatarImg; // شخصیتِ آواتارِ انتخابی (<id>.<ext>؛ خالی ⇒ تصادفی)
final String mobile;
final int level;
final int trophies;
@@ -35,6 +36,7 @@ class ProfileEntity {
const ProfileEntity({
required this.name,
required this.avatar,
this.avatarImg = '',
required this.mobile,
required this.level,
required this.trophies,
@@ -8,6 +8,7 @@ import '../../../../core/settings/app_settings.dart';
import '../../../../core/theme/app_theme.dart';
import '../../../../core/theme/ranks.dart';
import '../../../../core/widgets/game_ui.dart';
import '../../../../core/widgets/player_avatar.dart';
import '../../../../core/widgets/rank_badge.dart';
import '../../../wallet/presentation/bloc/wallet_bloc.dart';
import '../../../wallet/presentation/bloc/wallet_event.dart';
@@ -40,7 +40,11 @@ class _HeroCard extends StatelessWidget {
shape: BoxShape.circle,
color: AppColors.bgDark,
),
child: RandomAvatar(d.avatar, height: 90, width: 90),
child: PlayerAvatar(
seed: d.avatar,
imageUrl: d.avatarImg,
size: 90,
),
),
),
Positioned(