👽 Update the API request path due to the sepration of the wallet service

This commit is contained in:
2026-02-05 00:14:18 +08:00
parent 0237e457fc
commit 4b1c9b5820
7 changed files with 297 additions and 325 deletions

View File

@@ -30,7 +30,7 @@ part 'wallet.g.dart';
Future<SnWallet?> walletCurrent(Ref ref) async { Future<SnWallet?> walletCurrent(Ref ref) async {
try { try {
final apiClient = ref.watch(apiClientProvider); final apiClient = ref.watch(apiClientProvider);
final resp = await apiClient.get('/pass/wallets'); final resp = await apiClient.get('/wallet/wallets');
return SnWallet.fromJson(resp.data); return SnWallet.fromJson(resp.data);
} catch (err) { } catch (err) {
if (err is DioException && err.response?.statusCode == 404) { if (err is DioException && err.response?.statusCode == 404) {
@@ -43,7 +43,7 @@ Future<SnWallet?> walletCurrent(Ref ref) async {
@riverpod @riverpod
Future<SnWalletStats> walletStats(Ref ref) async { Future<SnWalletStats> walletStats(Ref ref) async {
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
final resp = await client.get('/pass/wallets/stats'); final resp = await client.get('/wallet/wallets/stats');
return SnWalletStats.fromJson(resp.data); return SnWalletStats.fromJson(resp.data);
} }
@@ -976,7 +976,7 @@ class TransactionListNotifier
final queryParams = {'offset': offset, 'take': pageSize}; final queryParams = {'offset': offset, 'take': pageSize};
final response = await client.get( final response = await client.get(
'/pass/wallets/transactions', '/wallet/wallets/transactions',
queryParameters: queryParams, queryParameters: queryParams,
); );
totalCount = int.parse(response.headers.value('X-Total') ?? '0'); totalCount = int.parse(response.headers.value('X-Total') ?? '0');
@@ -1003,7 +1003,7 @@ class WalletFundsNotifier extends AsyncNotifier<PaginationState<SnWalletFund>>
final offset = fetchedCount; final offset = fetchedCount;
final response = await client.get( final response = await client.get(
'/pass/wallets/funds?offset=$offset&take=$pageSize', '/wallet/wallets/funds?offset=$offset&take=$pageSize',
); );
// Assuming total count header is present or we just check if list is empty // Assuming total count header is present or we just check if list is empty
final list = (response.data as List) final list = (response.data as List)
@@ -1031,7 +1031,7 @@ class WalletFundRecipientsNotifier
final offset = fetchedCount; final offset = fetchedCount;
final response = await client.get( final response = await client.get(
'/pass/wallets/funds/recipients?offset=$offset&take=$_pageSize', '/wallet/wallets/funds/recipients?offset=$offset&take=$_pageSize',
); );
final list = (response.data as List) final list = (response.data as List)
.map((e) => SnWalletFundRecipient.fromJson(e)) .map((e) => SnWalletFundRecipient.fromJson(e))
@@ -1047,7 +1047,7 @@ class WalletFundRecipientsNotifier
@riverpod @riverpod
Future<SnWalletFund> walletFund(Ref ref, String fundId) async { Future<SnWalletFund> walletFund(Ref ref, String fundId) async {
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
final resp = await client.get('/pass/wallets/funds/$fundId'); final resp = await client.get('/wallet/wallets/funds/$fundId');
return SnWalletFund.fromJson(resp.data); return SnWalletFund.fromJson(resp.data);
} }
@@ -1239,7 +1239,7 @@ class WalletScreen extends HookConsumerWidget {
Future<void> createWallet() async { Future<void> createWallet() async {
final client = ref.read(apiClientProvider); final client = ref.read(apiClientProvider);
try { try {
await client.post('/pass/wallets'); await client.post('/wallet/wallets');
ref.invalidate(walletCurrentProvider); ref.invalidate(walletCurrentProvider);
} catch (err) { } catch (err) {
showErrorAlert(err); showErrorAlert(err);
@@ -1715,7 +1715,7 @@ class WalletScreen extends HookConsumerWidget {
try { try {
showLoadingModal(context); showLoadingModal(context);
final resp = await client.post( final resp = await client.post(
'/pass/wallets/funds', '/wallet/wallets/funds',
data: fundData, data: fundData,
options: Options(headers: {'X-Noop': true}), options: Options(headers: {'X-Noop': true}),
); );
@@ -1723,7 +1723,7 @@ class WalletScreen extends HookConsumerWidget {
if (fund.status == 0) return; // Already created if (fund.status == 0) return; // Already created
final orderResp = await client.post( final orderResp = await client.post(
'/pass/wallets/funds/${fund.id}/order', '/wallet/wallets/funds/${fund.id}/order',
); );
final order = SnWalletOrder.fromJson(orderResp.data); final order = SnWalletOrder.fromJson(orderResp.data);
@@ -1763,7 +1763,7 @@ class WalletScreen extends HookConsumerWidget {
final client = ref.read(apiClientProvider); final client = ref.read(apiClientProvider);
try { try {
showLoadingModal(context); showLoadingModal(context);
await client.post('/pass/wallets/transfer', data: transferData); await client.post('/wallet/wallets/transfer', data: transferData);
if (context.mounted) hideLoadingModal(context); if (context.mounted) hideLoadingModal(context);

View File

@@ -31,7 +31,7 @@ class RestorePurchaseSheet extends HookConsumerWidget {
try { try {
final client = ref.read(apiClientProvider); final client = ref.read(apiClientProvider);
await client.post( await client.post(
'/pass/subscriptions/order/restore/${selectedProvider.value!}', '/wallet/subscriptions/order/restore/${selectedProvider.value!}',
data: {'order_id': orderIdController.text.trim()}, data: {'order_id': orderIdController.text.trim()},
); );
@@ -79,8 +79,7 @@ class RestorePurchaseSheet extends HookConsumerWidget {
hint: Text('selectProvider'.tr()), hint: Text('selectProvider'.tr()),
isExpanded: true, isExpanded: true,
padding: const EdgeInsets.symmetric(horizontal: 12), padding: const EdgeInsets.symmetric(horizontal: 12),
items: items: providers.map((provider) {
providers.map((provider) {
return DropdownMenuItem<String>( return DropdownMenuItem<String>(
value: provider, value: provider,
child: Row( child: Row(
@@ -122,8 +121,7 @@ class RestorePurchaseSheet extends HookConsumerWidget {
// Restore Button // Restore Button
FilledButton( FilledButton(
onPressed: isLoading.value ? null : restorePurchase, onPressed: isLoading.value ? null : restorePurchase,
child: child: isLoading.value
isLoading.value
? const SizedBox( ? const SizedBox(
height: 20, height: 20,
width: 20, width: 20,

View File

@@ -30,7 +30,7 @@ part 'stellar_program_tab.g.dart';
Future<SnWalletSubscription?> accountStellarSubscription(Ref ref) async { Future<SnWalletSubscription?> accountStellarSubscription(Ref ref) async {
try { try {
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
final resp = await client.get('/pass/subscriptions/fuzzy/solian.stellar'); final resp = await client.get('/wallet/subscriptions/fuzzy/solian.stellar');
return SnWalletSubscription.fromJson(resp.data); return SnWalletSubscription.fromJson(resp.data);
} catch (err) { } catch (err) {
if (err is DioException && err.response?.statusCode == 404) return null; if (err is DioException && err.response?.statusCode == 404) return null;
@@ -46,7 +46,7 @@ Future<List<SnWalletGift>> accountSentGifts(
}) async { }) async {
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
final resp = await client.get( final resp = await client.get(
'/pass/subscriptions/gifts/sent?offset=$offset&take=$take', '/wallet/subscriptions/gifts/sent?offset=$offset&take=$take',
); );
return (resp.data as List).map((e) => SnWalletGift.fromJson(e)).toList(); return (resp.data as List).map((e) => SnWalletGift.fromJson(e)).toList();
} }
@@ -59,7 +59,7 @@ Future<List<SnWalletGift>> accountReceivedGifts(
}) async { }) async {
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
final resp = await client.get( final resp = await client.get(
'/pass/subscriptions/gifts/received?offset=$offset&take=$take', '/wallet/subscriptions/gifts/received?offset=$offset&take=$take',
); );
return (resp.data as List).map((e) => SnWalletGift.fromJson(e)).toList(); return (resp.data as List).map((e) => SnWalletGift.fromJson(e)).toList();
} }
@@ -67,7 +67,7 @@ Future<List<SnWalletGift>> accountReceivedGifts(
@riverpod @riverpod
Future<SnWalletGift> accountGift(Ref ref, String giftId) async { Future<SnWalletGift> accountGift(Ref ref, String giftId) async {
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
final resp = await client.get('/pass/subscriptions/gifts/$giftId'); final resp = await client.get('/wallet/subscriptions/gifts/$giftId');
return SnWalletGift.fromJson(resp.data); return SnWalletGift.fromJson(resp.data);
} }
@@ -379,7 +379,7 @@ class StellarProgramTab extends HookConsumerWidget {
showLoadingModal(context); showLoadingModal(context);
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
await client.post( await client.post(
'/pass/subscriptions/${membership.identifier}/cancel', '/wallet/subscriptions/${membership.identifier}/cancel',
); );
ref.invalidate(accountStellarSubscriptionProvider); ref.invalidate(accountStellarSubscriptionProvider);
ref.read(userInfoProvider.notifier).fetchUser(); ref.read(userInfoProvider.notifier).fetchUser();
@@ -680,7 +680,7 @@ class StellarProgramTab extends HookConsumerWidget {
try { try {
showLoadingModal(context); showLoadingModal(context);
final resp = await client.post( final resp = await client.post(
'/pass/subscriptions', '/wallet/subscriptions',
data: { data: {
'identifier': tierId, 'identifier': tierId,
'payment_method': 'solian.wallet', 'payment_method': 'solian.wallet',
@@ -692,7 +692,7 @@ class StellarProgramTab extends HookConsumerWidget {
final subscription = SnWalletSubscription.fromJson(resp.data); final subscription = SnWalletSubscription.fromJson(resp.data);
if (subscription.status == 1) return; if (subscription.status == 1) return;
final orderResp = await client.post( final orderResp = await client.post(
'/pass/subscriptions/${subscription.identifier}/order', '/wallet/subscriptions/${subscription.identifier}/order',
); );
final order = SnWalletOrder.fromJson(orderResp.data); final order = SnWalletOrder.fromJson(orderResp.data);
@@ -1188,7 +1188,7 @@ class StellarProgramTab extends HookConsumerWidget {
try { try {
showLoadingModal(context); showLoadingModal(context);
final resp = await client.post( final resp = await client.post(
'/pass/subscriptions/gifts/purchase', '/wallet/subscriptions/gifts/purchase',
data: { data: {
'subscription_identifier': subscriptionId, 'subscription_identifier': subscriptionId,
'recipient_id': ?recipientId, 'recipient_id': ?recipientId,
@@ -1204,7 +1204,7 @@ class StellarProgramTab extends HookConsumerWidget {
if (gift.status == 1) return; // Already paid if (gift.status == 1) return; // Already paid
final orderResp = await client.post( final orderResp = await client.post(
'/pass/subscriptions/gifts/${gift.id}/order', '/wallet/subscriptions/gifts/${gift.id}/order',
); );
final order = SnWalletOrder.fromJson(orderResp.data); final order = SnWalletOrder.fromJson(orderResp.data);
@@ -1226,7 +1226,7 @@ class StellarProgramTab extends HookConsumerWidget {
// Get the updated gift // Get the updated gift
final giftResp = await client.get( final giftResp = await client.get(
'/pass/subscriptions/gifts/${gift.id}', '/wallet/subscriptions/gifts/${gift.id}',
); );
final updatedGift = SnWalletGift.fromJson(giftResp.data); final updatedGift = SnWalletGift.fromJson(giftResp.data);
@@ -1328,7 +1328,7 @@ class StellarProgramTab extends HookConsumerWidget {
// First check if gift can be redeemed // First check if gift can be redeemed
final checkResp = await client.get( final checkResp = await client.get(
'/pass/subscriptions/gifts/check/$giftCode', '/wallet/subscriptions/gifts/check/$giftCode',
); );
final checkData = checkResp.data as Map<String, dynamic>; final checkData = checkResp.data as Map<String, dynamic>;
@@ -1340,7 +1340,7 @@ class StellarProgramTab extends HookConsumerWidget {
// Redeem the gift // Redeem the gift
await client.post( await client.post(
'/pass/subscriptions/gifts/redeem', '/wallet/subscriptions/gifts/redeem',
data: {'gift_code': giftCode}, data: {'gift_code': giftCode},
); );
@@ -1384,7 +1384,7 @@ class StellarProgramTab extends HookConsumerWidget {
final client = ref.watch(apiClientProvider); final client = ref.watch(apiClientProvider);
try { try {
showLoadingModal(context); showLoadingModal(context);
await client.post('/pass/subscriptions/gifts/${gift.id}/cancel'); await client.post('/wallet/subscriptions/gifts/${gift.id}/cancel');
ref.invalidate(accountSentGiftsProvider); ref.invalidate(accountSentGiftsProvider);
if (context.mounted) { if (context.mounted) {
hideLoadingModal(context); hideLoadingModal(context);

View File

@@ -66,8 +66,7 @@ class PaymentOverlay extends HookConsumerWidget {
isScrollControlled: true, isScrollControlled: true,
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
useSafeArea: true, useSafeArea: true,
builder: builder: (context) => PaymentOverlay(
(context) => PaymentOverlay(
order: order, order: order,
enableBiometric: enableBiometric, enableBiometric: enableBiometric,
onPaymentSuccess: (completedOrder) { onPaymentSuccess: (completedOrder) {
@@ -241,7 +240,7 @@ class _PaymentContentState extends ConsumerState<_PaymentContent> {
try { try {
final client = ref.read(apiClientProvider); final client = ref.read(apiClientProvider);
final response = await client.post( final response = await client.post(
'/pass/orders/${widget.order.id}/pay', '/wallet/orders/${widget.order.id}/pay',
data: {'pin_code': pin}, data: {'pin_code': pin},
); );
@@ -415,8 +414,7 @@ class _PaymentContentState extends ConsumerState<_PaymentContent> {
Widget _buildBiometricAuth() { Widget _buildBiometricAuth() {
return SingleChildScrollView( return SingleChildScrollView(
child: child: Column(
Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
@@ -443,10 +441,7 @@ class _PaymentContentState extends ConsumerState<_PaymentContent> {
icon: const Icon(Symbols.fingerprint), icon: const Icon(Symbols.fingerprint),
label: Text('authenticateNow'.tr()), label: Text('authenticateNow'.tr()),
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
horizontal: 24,
vertical: 12,
),
), ),
), ),
TextButton( TextButton(

View File

@@ -232,7 +232,7 @@ class ComposeFundSheet extends HookConsumerWidget {
showLoadingModal(context); showLoadingModal(context);
final resp = await client.post( final resp = await client.post(
'/pass/wallets/funds', '/wallet/wallets/funds',
data: result, data: result,
options: Options( options: Options(
headers: {'X-Noop': true}, headers: {'X-Noop': true},
@@ -253,7 +253,7 @@ class ComposeFundSheet extends HookConsumerWidget {
} }
final orderResp = await client.post( final orderResp = await client.post(
'/pass/wallets/funds/${fund.id}/order', '/wallet/wallets/funds/${fund.id}/order',
); );
final order = SnWalletOrder.fromJson( final order = SnWalletOrder.fromJson(
orderResp.data, orderResp.data,
@@ -284,7 +284,7 @@ class ComposeFundSheet extends HookConsumerWidget {
// Return the created fund // Return the created fund
final updatedResp = await client.get( final updatedResp = await client.get(
'/pass/wallets/funds/${fund.id}', '/wallet/wallets/funds/${fund.id}',
); );
final updatedFund = final updatedFund =
SnWalletFund.fromJson( SnWalletFund.fromJson(

View File

@@ -311,7 +311,7 @@ class PostAwardSheet extends HookConsumerWidget {
final orderId = awardResponse.data['order_id'] as String; final orderId = awardResponse.data['order_id'] as String;
// Fetch order details // Fetch order details
final orderResponse = await client.get('/pass/orders/$orderId'); final orderResponse = await client.get('/wallet/orders/$orderId');
final order = SnWalletOrder.fromJson(orderResponse.data); final order = SnWalletOrder.fromJson(orderResponse.data);
if (context.mounted) { if (context.mounted) {

View File

@@ -12,7 +12,7 @@ part 'fund_envelope.g.dart';
@riverpod @riverpod
Future<SnWalletFund> walletFund(Ref ref, String fundId) async { Future<SnWalletFund> walletFund(Ref ref, String fundId) async {
final apiClient = ref.watch(apiClientProvider); final apiClient = ref.watch(apiClientProvider);
final resp = await apiClient.get('/pass/wallets/funds/$fundId'); final resp = await apiClient.get('/wallet/wallets/funds/$fundId');
return SnWalletFund.fromJson(resp.data); return SnWalletFund.fromJson(resp.data);
} }
@@ -36,16 +36,14 @@ class FundEnvelopeWidget extends HookConsumerWidget {
width: maxWidth, width: maxWidth,
margin: margin ?? const EdgeInsets.symmetric(vertical: 8), margin: margin ?? const EdgeInsets.symmetric(vertical: 8),
child: fundAsync.when( child: fundAsync.when(
loading: loading: () => Card(
() => Card(
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
child: const Padding( child: const Padding(
padding: EdgeInsets.all(16), padding: EdgeInsets.all(16),
child: Center(child: CircularProgressIndicator()), child: Center(child: CircularProgressIndicator()),
), ),
), ),
error: error: (error, stack) => Card(
(error, stack) => Card(
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
child: Padding( child: Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
@@ -58,16 +56,13 @@ class FundEnvelopeWidget extends HookConsumerWidget {
const SizedBox(height: 8), const SizedBox(height: 8),
Text( Text(
'fundEnvelopeLoadFailed'.tr(), 'fundEnvelopeLoadFailed'.tr(),
style: TextStyle( style: TextStyle(color: Theme.of(context).colorScheme.error),
color: Theme.of(context).colorScheme.error,
),
), ),
], ],
), ),
), ),
), ),
data: data: (fund) => Card(
(fund) => Card(
margin: EdgeInsets.zero, margin: EdgeInsets.zero,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: InkWell( child: InkWell(
@@ -106,9 +101,8 @@ class FundEnvelopeWidget extends HookConsumerWidget {
children: [ children: [
Text( Text(
'${fund.totalAmount.toStringAsFixed(2)} ${fund.currency}', '${fund.totalAmount.toStringAsFixed(2)} ${fund.currency}',
style: Theme.of( style: Theme.of(context).textTheme.headlineSmall
context, ?.copyWith(
).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),
@@ -122,11 +116,11 @@ class FundEnvelopeWidget extends HookConsumerWidget {
fund.currency, fund.currency,
], ],
), ),
style: Theme.of( style: Theme.of(context).textTheme.bodySmall
?.copyWith(
color: Theme.of(
context, context,
).textTheme.bodySmall?.copyWith( ).colorScheme.secondary,
color:
Theme.of(context).colorScheme.secondary,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
), ),
@@ -138,9 +132,8 @@ class FundEnvelopeWidget extends HookConsumerWidget {
: 'fundEnvelopeSplitRandomly'.tr(), : 'fundEnvelopeSplitRandomly'.tr(),
], ],
), ),
style: Theme.of( style: Theme.of(context).textTheme.bodySmall
context, ?.copyWith(
).textTheme.bodySmall?.copyWith(
color: Theme.of(context) color: Theme.of(context)
.textTheme .textTheme
.bodySmall .bodySmall
@@ -164,12 +157,9 @@ class FundEnvelopeWidget extends HookConsumerWidget {
const SizedBox(height: 12), const SizedBox(height: 12),
Text( Text(
'"${fund.message}"', '"${fund.message}"',
style: Theme.of( style: Theme.of(context).textTheme.bodyMedium?.copyWith(
context,
).textTheme.bodyMedium?.copyWith(
fontStyle: FontStyle.italic, fontStyle: FontStyle.italic,
color: color: Theme.of(context).colorScheme.onSurfaceVariant,
Theme.of(context).colorScheme.onSurfaceVariant,
), ),
), ),
], ],
@@ -182,19 +172,14 @@ class FundEnvelopeWidget extends HookConsumerWidget {
Icon( Icon(
Icons.person, Icons.person,
size: 16, size: 16,
color: color: Theme.of(context).colorScheme.onSurfaceVariant,
Theme.of(
context,
).colorScheme.onSurfaceVariant,
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
Text( Text(
fund.creatorAccount!.nick, fund.creatorAccount!.nick,
style: Theme.of( style: Theme.of(context).textTheme.bodySmall
context, ?.copyWith(
).textTheme.bodySmall?.copyWith( color: Theme.of(
color:
Theme.of(
context, context,
).colorScheme.onSurfaceVariant, ).colorScheme.onSurfaceVariant,
), ),
@@ -210,19 +195,13 @@ class FundEnvelopeWidget extends HookConsumerWidget {
Icon( Icon(
Icons.schedule, Icons.schedule,
size: 16, size: 16,
color: color: Theme.of(context).colorScheme.onSurfaceVariant,
Theme.of(context).colorScheme.onSurfaceVariant,
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
Text( Text(
_formatDate(fund.expiredAt), _formatDate(fund.expiredAt),
style: Theme.of( style: Theme.of(context).textTheme.bodySmall?.copyWith(
context, color: Theme.of(context).colorScheme.onSurfaceVariant,
).textTheme.bodySmall?.copyWith(
color:
Theme.of(
context,
).colorScheme.onSurfaceVariant,
), ),
), ),
], ],
@@ -243,13 +222,12 @@ class FundEnvelopeWidget extends HookConsumerWidget {
) { ) {
showDialog( showDialog(
context: context, context: context,
builder: builder: (dialogContext) => FundClaimDialog(
(dialogContext) => FundClaimDialog(
fund: fund, fund: fund,
onClaim: () async { onClaim: () async {
try { try {
final apiClient = ref.read(apiClientProvider); final apiClient = ref.read(apiClientProvider);
await apiClient.post('/pass/wallets/funds/${fund.id}/receive'); await apiClient.post('/wallet/wallets/funds/${fund.id}/receive');
// Refresh the fund data after claiming // Refresh the fund data after claiming
ref.invalidate(walletFundProvider(fund.id)); ref.invalidate(walletFundProvider(fund.id));
@@ -343,8 +321,9 @@ class FundEnvelopeWidget extends HookConsumerWidget {
Widget _buildRecipientsOverview(BuildContext context, SnWalletFund fund) { Widget _buildRecipientsOverview(BuildContext context, SnWalletFund fund) {
final claimedCount = fund.recipients.where((r) => r.isReceived).length; final claimedCount = fund.recipients.where((r) => r.isReceived).length;
final totalCount = final totalCount = fund.isOpen
fund.isOpen ? fund.amountOfSplits : fund.recipients.length; ? fund.amountOfSplits
: fund.recipients.length;
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@@ -362,8 +341,9 @@ class FundEnvelopeWidget extends HookConsumerWidget {
const SizedBox(height: 4), const SizedBox(height: 4),
LinearProgressIndicator( LinearProgressIndicator(
value: totalCount > 0 ? claimedCount / totalCount : 0, value: totalCount > 0 ? claimedCount / totalCount : 0,
backgroundColor: backgroundColor: Theme.of(
Theme.of(context).colorScheme.surfaceContainerHighest, context,
).colorScheme.surfaceContainerHighest,
), ),
], ],
); );
@@ -436,13 +416,14 @@ class FundClaimDialog extends HookConsumerWidget {
!isExpired && hasRemainingAmount && !hasUserClaimed && userAbleToClaim; !isExpired && hasRemainingAmount && !hasUserClaimed && userAbleToClaim;
// Get claimed recipients for display // Get claimed recipients for display
final claimedRecipients = final claimedRecipients = fund.recipients
fund.recipients.where((r) => r.isReceived).toList(); .where((r) => r.isReceived)
final unclaimedRecipients = .toList();
fund.recipients.where((r) => !r.isReceived).toList(); final unclaimedRecipients = fund.recipients
.where((r) => !r.isReceived)
.toList();
final remainingSplits = final remainingSplits = fund.isOpen
fund.isOpen
? fund.amountOfSplits - claimedRecipients.length ? fund.amountOfSplits - claimedRecipients.length
: unclaimedRecipients.length; : unclaimedRecipients.length;
@@ -491,14 +472,12 @@ class FundClaimDialog extends HookConsumerWidget {
Container( Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration( decoration: BoxDecoration(
color: color: fund.isOpen
fund.isOpen
? Colors.green.withOpacity(0.1) ? Colors.green.withOpacity(0.1)
: Colors.blue.withOpacity(0.1), : Colors.blue.withOpacity(0.1),
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
border: Border.all( border: Border.all(
color: color: fund.isOpen
fund.isOpen
? Colors.green.withOpacity(0.3) ? Colors.green.withOpacity(0.3)
: Colors.blue.withOpacity(0.3), : Colors.blue.withOpacity(0.3),
), ),
@@ -535,12 +514,12 @@ class FundClaimDialog extends HookConsumerWidget {
child: Text( child: Text(
recipient.recipientAccount?.nick ?? recipient.recipientAccount?.nick ??
'fundEnvelopeUnknownUser'.tr(), 'fundEnvelopeUnknownUser'.tr(),
style: Theme.of( style: Theme.of(context).textTheme.bodySmall
context, ?.copyWith(
).textTheme.bodySmall?.copyWith(
decoration: TextDecoration.lineThrough, decoration: TextDecoration.lineThrough,
color: color: Theme.of(
Theme.of(context).colorScheme.onSurfaceVariant, context,
).colorScheme.onSurfaceVariant,
), ),
), ),
), ),