Skip to content

Conversation

@smk762
Copy link
Collaborator

@smk762 smk762 commented Oct 20, 2025

Fixes bug blocking NFT withdraws. Previously the errors below would happen on click.

image
AppBlocObserver -> onError
NftWithdrawBloc: Bad state: GetIt: Object/factory with type AnalyticsBloc is not registered inside GetIt. 
(Did you accidentally do GetIt sl=GetIt.instance(); instead of GetIt sl=GetIt.instance;
Did you forget to register it?)
Trace: #0      throwIfNot (package:get_it/get_it_impl.dart:14)
#1      _GetItImplementation._findRegistrationByNameAndType (package:get_it/get_it_impl.dart:583)
#2      _GetItImplementation._get (package:get_it/get_it_impl.dart:641)
#3      _GetItImplementation.get (package:get_it/get_it_impl.dart:608)
#4      _GetItImplementation.call (package:get_it/get_it_impl.dart:720)
#5      NftWithdrawBloc._onSend (package:web_dex/bloc/nft_withdraw/nft_withdraw_bloc.dart:103)
<asynchronous suspension>
#6      Bloc.on.<anonymous closure>.handleEvent (package:bloc/src/bloc.dart:226)
<asynchronous suspension>

[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Bad state: GetIt: Object/factory with type AnalyticsBloc is not registered inside GetIt. 
(Did you accidentally do GetIt sl=GetIt.instance(); instead of GetIt sl=GetIt.instance;
Did you forget to register it?)
#0      throwIfNot (package:get_it/get_it_impl.dart:14)
#1      _GetItImplementation._findRegistrationByNameAndType (package:get_it/get_it_impl.dart:583)
#2      _GetItImplementation._get (package:get_it/get_it_impl.dart:641)
#3      _GetItImplementation.get (package:get_it/get_it_impl.dart:608)
#4      _GetItImplementation.call (package:get_it/get_it_impl.dart:720)
#5      NftWithdrawBloc._onSend (package:web_dex/bloc/nft_withdraw/nft_withdraw_bloc.dart:103)
<asynchronous suspension>
#6      Bloc.on.<anonymous closure>.handleEvent (package:bloc/src/bloc.dart:226)
<asynchronous suspension>

To Test:

  • attempt to withdraw an NFT. If you succeeds, it worked.

@smk762 smk762 requested review from CharlVS and takenagain October 20, 2025 15:22
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/nft-withdraw

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 30c9e94):

https://walletrc--pull-3202-merge-jqaz4q6x.web.app

(expires Mon, 27 Oct 2025 15:28:48 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: f66a4ff03faa546f12f0ae5a841bd9eff2714dcc

Copy link
Collaborator

@CharlVS CharlVS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this one :)

Blocs should never be referencing other blocs. They can only share repositories (and repositories should hold little/no state). This ensures that the app's business logic is neatly separated into independant "silos" which can be changed/removed without worrying about breaking other parts of the app.

@CharlVS CharlVS merged commit 6765fa9 into dev Oct 20, 2025
7 of 13 checks passed
@CharlVS CharlVS deleted the fix/nft-withdraw branch October 20, 2025 18:44
@smk762 smk762 mentioned this pull request Nov 23, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants