-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: (balance) 🐛 fixed multiple balance load bug #217
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome work! just two minor comments ad we're good to go
onTapDone: () async { | ||
unawaited( | ||
Navigator.of(context).pushAndRemoveUntil( | ||
MaterialPageRoute( | ||
builder: (_) => const AssetsPortfolioPage(), | ||
), | ||
(route) => false, | ||
), | ||
); | ||
|
||
await StarportApp.walletsStore.getBalances(selectedWallet.publicAddress); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a rule of a thumb, let's extract user interaction code to a separate method, outside of the build
method for readability:
onTapDone: () async { | |
unawaited( | |
Navigator.of(context).pushAndRemoveUntil( | |
MaterialPageRoute( | |
builder: (_) => const AssetsPortfolioPage(), | |
), | |
(route) => false, | |
), | |
); | |
await StarportApp.walletsStore.getBalances(selectedWallet.publicAddress); | |
}, | |
onTapDone: onTapDone, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is still not updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about that didnt push the commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can check it out now
Co-authored-by: Andrzej Chmielewski <andrzejchm@users.noreply.github.com>
|
||
await StarportApp.walletsStore.getBalances(selectedWallet.publicAddress); | ||
}, | ||
Future<void> _handleAssetTranserSheetDone(BuildContext context) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the rule for naming the user event methods is to call them _onTap{what}
_onLongPress{what}
, onSwipe{{what}
and then within the method we decide what to do with the action. this way its a bit easier to comprehend the intention of the method and eventually modifying the logic inside of it does not require us to rename it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see I mostly default to using the handle {what}
method no problem will modify and follow this, Is there a way we can document these project rules and all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Do i need to wait for @wal33d006 to approve? |
I'll merge this one as Waleed is unavailable at the moment, but in the future let's give him a chance to review the code before merging :) |
|
Fixed bug causing the balanceList to load and update multiple times in
_fetchWalletBalances()
and infixes #210