fix: frames
This commit is contained in:
@@ -1,27 +1,18 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../theme/app_theme.dart';
|
||||
import '../theme/ranks.dart';
|
||||
|
||||
/// نشانِ رتبه (برنز/نقره/طلا/الماس/پادشاه) با رنگ و برچسبِ فارسی.
|
||||
/// نشانِ رتبه (برنز/نقره/طلا/الماس/پادشاه) با رنگ و برچسبِ فارسی از سرور.
|
||||
class RankBadge extends StatelessWidget {
|
||||
final String tier; // bronze..king
|
||||
final int? points; // در صورت نمایش امتیاز
|
||||
final double size;
|
||||
const RankBadge({super.key, required this.tier, this.points, this.size = 16});
|
||||
|
||||
static const _tiers = {
|
||||
'bronze': ('برنز', [Color(0xFFCD7F32), Color(0xFF8C5A2B)]),
|
||||
'silver': ('نقره', [Color(0xFFBFC6CC), Color(0xFF8A949B)]),
|
||||
'gold': ('طلا', [Color(0xFFFFD54F), AppColors.goldDark]),
|
||||
'diamond': ('الماس', [Color(0xFF5BE0E6), Color(0xFF1E8A99)]),
|
||||
'king': ('پادشاه', [Color(0xFFB388FF), Color(0xFF6A1B9A)]),
|
||||
};
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final t = _tiers[tier] ?? _tiers['bronze']!;
|
||||
final label = t.$1;
|
||||
final colors = t.$2;
|
||||
final label = rankLabel(tier);
|
||||
final colors = rankGradient(tier);
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: size * 0.6, vertical: size * 0.25),
|
||||
decoration: BoxDecoration(
|
||||
|
||||
Reference in New Issue
Block a user