refactor unnecessary provider watch

This commit is contained in:
julian 2024-01-18 13:33:50 -06:00
parent 0e0b516ea0
commit dd0fc6f369

View file

@ -23,6 +23,7 @@ import 'package:stackwallet/providers/db/main_db_provider.dart';
import 'package:stackwallet/providers/global/wallets_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/util.dart';
import 'package:stackwallet/widgets/loading_indicator.dart';
@ -44,6 +45,7 @@ class _TransactionsV2ListState extends ConsumerState<TransactionsV2List> {
late final StreamSubscription<List<TransactionV2>> _subscription;
late final Query<TransactionV2> _query;
late final Coin coin;
BorderRadius get _borderRadiusFirst {
return BorderRadius.only(
@ -69,6 +71,7 @@ class _TransactionsV2ListState extends ConsumerState<TransactionsV2List> {
@override
void initState() {
coin = ref.read(pWallets).getWallet(widget.walletId).info.coin;
_query = ref
.read(mainDBProvider)
.isar
@ -110,8 +113,6 @@ class _TransactionsV2ListState extends ConsumerState<TransactionsV2List> {
@override
Widget build(BuildContext context) {
final coin = ref.watch(pWallets).getWallet(widget.walletId).info.coin;
return FutureBuilder(
future: _query.findAll(),
builder: (fbContext, AsyncSnapshot<List<TransactionV2>> snapshot) {