👽 Changes due to the lotteries data has been moved to wallet

This commit is contained in:
2026-02-05 16:36:45 +08:00
parent f2819a9d92
commit 5414dfd4f0

View File

@@ -22,7 +22,7 @@ Future<List<SnLotteryTicket>> lotteryTickets(
int take = 20,
}) async {
final client = ref.watch(apiClientProvider);
final resp = await client.get('/pass/lotteries?offset=$offset&take=$take');
final resp = await client.get('/wallet/lotteries?offset=$offset&take=$take');
return (resp.data as List).map((e) => SnLotteryTicket.fromJson(e)).toList();
}
@@ -34,7 +34,7 @@ Future<List<SnLotteryRecord>> lotteryRecords(
}) async {
final client = ref.watch(apiClientProvider);
final resp = await client.get(
'/pass/lotteries/records?offset=$offset&take=$take',
'/wallet/lotteries/records?offset=$offset&take=$take',
);
return (resp.data as List).map((e) => SnLotteryRecord.fromJson(e)).toList();
}
@@ -49,7 +49,10 @@ class LotteryTab extends StatelessWidget {
child: Column(
children: [
TabBar(
tabs: [Tab(text: 'myTickets'.tr()), Tab(text: 'drawHistory'.tr())],
tabs: [
Tab(text: 'myTickets'.tr()),
Tab(text: 'drawHistory'.tr()),
],
),
Expanded(
child: TabBarView(
@@ -226,7 +229,7 @@ class LotteryTicketsList extends HookConsumerWidget {
// The lottery API creates the order for us
final orderResponse = await client.post(
'/pass/lotteries',
'/wallet/lotteries',
data: purchaseData,
);
@@ -349,16 +352,13 @@ class LotteryTicketsList extends HookConsumerWidget {
textColor = Colors.white;
borderColor = Colors.green;
} else {
backgroundColor =
isSpecial
backgroundColor = isSpecial
? Theme.of(context).colorScheme.secondary
: Theme.of(context).colorScheme.surface;
textColor =
isSpecial
textColor = isSpecial
? Theme.of(context).colorScheme.onSecondary
: Theme.of(context).colorScheme.onSurface;
borderColor =
isSpecial
borderColor = isSpecial
? Theme.of(context).colorScheme.secondary
: Theme.of(context).colorScheme.outline.withOpacity(0.3);
@@ -679,21 +679,17 @@ class _LotteryPurchaseSheetState extends State<LotteryPurchaseSheet> {
onTap: () => _toggleNumber(number),
child: Container(
decoration: BoxDecoration(
color:
isSpecialNumber
color: isSpecialNumber
? Theme.of(context).colorScheme.secondary
: isSelected
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.surface,
border: Border.all(
color:
isSpecialNumber
color: isSpecialNumber
? Theme.of(context).colorScheme.secondary
: isSelected
? Theme.of(context).colorScheme.primary
: Theme.of(
context,
).colorScheme.outline.withOpacity(0.3),
: Theme.of(context).colorScheme.outline.withOpacity(0.3),
),
borderRadius: BorderRadius.circular(8),
),
@@ -701,8 +697,7 @@ class _LotteryPurchaseSheetState extends State<LotteryPurchaseSheet> {
child: Text(
number.toString().padLeft(2, '0'),
style: TextStyle(
color:
isSpecialNumber
color: isSpecialNumber
? Theme.of(context).colorScheme.onSecondary
: isSelected
? Theme.of(context).colorScheme.onPrimary
@@ -773,8 +768,7 @@ class _LotteryPurchaseSheetState extends State<LotteryPurchaseSheet> {
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
children:
prizeStructure.entries.map((entry) {
children: prizeStructure.entries.map((entry) {
return Padding(
padding: const EdgeInsets.only(bottom: 8),
child: Row(
@@ -785,9 +779,7 @@ class _LotteryPurchaseSheetState extends State<LotteryPurchaseSheet> {
? 'specialOnly'.tr()
: entry.key.tr(),
),
Text(
'${entry.value} ${'walletCurrencyShortPoints'.tr()}',
),
Text('${entry.value} ${'walletCurrencyShortPoints'.tr()}'),
],
),
);