Skip to content
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

Close scanner onCodeRead #15

Open
Cypher-XI opened this issue Dec 15, 2018 · 4 comments
Open

Close scanner onCodeRead #15

Cypher-XI opened this issue Dec 15, 2018 · 4 comments

Comments

@Cypher-XI
Copy link

Cypher-XI commented Dec 15, 2018

How could I close the scanner properly when onCodeRead is triggered?

my onCodeRead method is,

void onCodeRead(dynamic value) {
    Navigator.pop(context, value.toString());
  }

getting the flowing error log continuously

I/flutter (29734): Another exception was thrown: 'package:flutter/src/widgets/framework.dart': Failed assertion: line 3473 pos 12: '_debugLifecycleState != _ElementLifecycle.defunct': is not true.

How could I fix this issue?

@facundomedica
Copy link
Owner

Try with:

    controller?.dispose();

before popping the screen

@Cypher-XI
Copy link
Author

Try with:

    controller?.dispose();

before popping the screen

No use. I couldn't see any difference in debug console

@xellDart
Copy link

sane error

@zarulizham
Copy link

I have faced the same problem. My problem solved when I dispose animationController too.

  @override
  void dispose() {
    animationController?.dispose();
    controller?.dispose();
    super.dispose();
  }

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

No branches or pull requests

4 participants