mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
refactor unnecessary provider watch
This commit is contained in:
parent
0e0b516ea0
commit
dd0fc6f369
1 changed files with 3 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue