Skip to content

Commit

Permalink
Manage loading
Browse files Browse the repository at this point in the history
  • Loading branch information
redDwarf03 committed Jan 20, 2025
1 parent b2139e6 commit ace0048
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import 'package:archethic_lib_dart/archethic_lib_dart.dart' as archethic;
/// - [ApiService]: For interacting with the Archethic blockchain API.
/// - [TokensRepository]: For fetching token metadata and details.
// TODO(reddwarf03): Skip transactions with protocol version < 7
class RecentTransactionsRepositoryImpl
with TokenParser
implements RecentTransactionsRepository {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Widget _amount(
children: [
Text(
hasTransactionInfo
? '$amountPrefix$amountFormatted ${primaryCurrency.primaryCurrency == AvailablePrimaryCurrencyEnum.native ? (mvtInfo.tokenInformation!.symbol != null && mvtInfo.tokenInformation!.symbol! == '' ? 'NFT' : mvtInfo.tokenInformation!.symbol!) : mvtInfo.tokenInformation!.symbol!}'
? '$amountPrefix$amountFormatted ${primaryCurrency.primaryCurrency == AvailablePrimaryCurrencyEnum.native ? (mvtInfo.tokenInformation!.symbol != null && mvtInfo.tokenInformation!.symbol! == '' ? 'NFT' : mvtInfo.tokenInformation!.symbol ?? '') : mvtInfo.tokenInformation!.symbol ?? ''}'
: '$amountPrefix$amountFormatted ${AccountBalance.cryptoCurrencyLabel}',
style: ArchethicThemeStyles.textStyleSize12W100Primary,
),
Expand Down
26 changes: 21 additions & 5 deletions lib/ui/views/transactions/transactions_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,38 @@ class _TransactionsListState extends ConsumerState<TransactionsList>

return Column(
children: [
recentTransactionsAsync.map(
recentTransactionsAsync.when(
skipLoadingOnRefresh: true,
skipLoadingOnReload: true,
data: (data) {
if (data.value.isEmpty) {
if (data.isEmpty) {
return _recentTransactionsEmpty(context);
}

return Column(
children: data.value.map((transaction) {
children: data.map((transaction) {
return TransactionDetail(
transaction: transaction,
);
}).toList(),
);
},
error: (_) => const SizedBox.shrink(),
loading: (_) => const SizedBox.shrink(),
error: (_, __) => const SizedBox.shrink(),
loading: () => const Padding(
padding: EdgeInsets.only(top: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
width: 30,
height: 30,
child: CircularProgressIndicator(
strokeWidth: 0.5,
),
),
],
),
),
),
],
);
Expand Down

0 comments on commit ace0048

Please sign in to comment.