Skip to content

Fix unhandled exception on Current Account page #1855

Description

@simaopsbarbosa

when visiting the current account page, closing and reopening i got this error:

E/flutter (13773): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Bad state: Using "ref" when a widget is about to or has been unmounted is unsafe.
E/flutter (13773): Ref relies on BuildContext, and BuildContext is unsafe to use when the widget is deactivated.
E/flutter (13773): To safely refer to the state of providers inside State.dispose(), save the provider state in a field of your State class.

vscode showed this error next to line 38 of current_account.dart:

await ref.read(profileProvider.future);

this error caused the app to crash

Metadata

Metadata

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

Status
Assigned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions