"see all" token txns fix

This commit is contained in:
julian 2023-10-18 13:58:56 -06:00
parent 2e83d57ad9
commit be3f82e070
5 changed files with 33 additions and 9 deletions

View file

@ -225,8 +225,8 @@ class _TransactionsListState extends ConsumerState<TokenTransactionsList> {
_hasLoaded = true;
}
if (!_hasLoaded) {
return Column(
children: const [
return const Column(
children: [
Spacer(),
Center(
child: LoadingIndicator(

View file

@ -191,7 +191,10 @@ class _TokenViewState extends ConsumerState<TokenView> {
onTap: () {
Navigator.of(context).pushNamed(
AllTransactionsView.routeName,
arguments: widget.walletId,
arguments: (
walletId: widget.walletId,
isTokens: true,
),
);
},
),

View file

@ -17,6 +17,7 @@ import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'
import 'package:stackwallet/models/isar/models/contact_entry.dart';
import 'package:stackwallet/models/transaction_filter.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/token_view/token_view.dart';
import 'package:stackwallet/pages/wallet_view/sub_widgets/tx_icon.dart';
import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart';
import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_search_filter_view.dart';
@ -50,11 +51,13 @@ class AllTransactionsView extends ConsumerStatefulWidget {
const AllTransactionsView({
Key? key,
required this.walletId,
this.isTokens = false,
}) : super(key: key);
static const String routeName = "/allTransactions";
final String walletId;
final bool isTokens;
@override
ConsumerState<AllTransactionsView> createState() =>
@ -445,12 +448,12 @@ class _TransactionDetailsViewState extends ConsumerState<AllTransactionsView> {
),
if (isDesktop &&
ref.watch(transactionFilterProvider.state).state != null)
Padding(
padding: const EdgeInsets.symmetric(
const Padding(
padding: EdgeInsets.symmetric(
vertical: 8,
),
child: Row(
children: const [
children: [
TransactionFilterOptionBar(),
],
),
@ -472,8 +475,11 @@ class _TransactionDetailsViewState extends ConsumerState<AllTransactionsView> {
// debugPrint("Consumer build called");
return FutureBuilder(
future: ref.watch(
managerProvider.select((value) => value.transactions)),
future: widget.isTokens
? ref.watch(tokenServiceProvider
.select((value) => value!.transactions))
: ref.watch(managerProvider
.select((value) => value.transactions)),
builder: (_, AsyncSnapshot<List<Transaction>> snapshot) {
if (snapshot.connectionState == ConnectionState.done &&
snapshot.hasData) {

View file

@ -218,7 +218,10 @@ class _DesktopTokenViewState extends ConsumerState<DesktopTokenView> {
onTap: () {
Navigator.of(context).pushNamed(
AllTransactionsView.routeName,
arguments: widget.walletId,
arguments: (
walletId: widget.walletId,
isTokens: true,
),
);
},
),

View file

@ -1260,6 +1260,18 @@ class RouteGenerator {
return _routeError("${settings.name} invalid args: ${args.toString()}");
case AllTransactionsView.routeName:
if (args is ({String walletId, bool isTokens})) {
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,
builder: (_) => AllTransactionsView(
walletId: args.walletId,
isTokens: args.isTokens,
),
settings: RouteSettings(
name: settings.name,
),
);
}
if (args is String) {
return getRoute(
shouldUseMaterialRoute: useMaterialPageRoute,