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

Stack Overflow when use Consumer in dialog #15

Closed
tbm98 opened this issue Jun 26, 2020 · 1 comment
Closed

Stack Overflow when use Consumer in dialog #15

tbm98 opened this issue Jun 26, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@tbm98
Copy link
Contributor

tbm98 commented Jun 26, 2020

  Future<void> _showDialogAddGhiChu(BuildContext context) async {
    return showDialog<void>(
      context: context,
      barrierDismissible: false, // user must tap button!
      builder: (_) {
        return Consumer((ct, read) {
          final clickDate = read(mainStateNotifier).clickDate;
          return AddNote(
            date: clickDate,
            context: ct,
          ); //magic ^_^
        });
      },
    );
  }

error

Another exception was thrown: Stack Overflow

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following StackOverflowError was thrown building Consumer(dirty, dependencies: [ProviderStateOwnerScope], state: _ConsumerState#34eeb):
Stack Overflow

The relevant error-causing widget was: 
  Consumer file:///Users/tbm98/dev/flutter_app/student-social/lib/presentation/screens/main/main_page.dart:132:16
When the exception was thrown, this was the stack: 
#0      MainState.getClickDate (package:studentsocial/presentation/screens/main/main_state.dart:35:3)
#1      MainState.getClickDate (package:studentsocial/presentation/screens/main/main_state.dart:35:32)
#2      MainState.getClickDate (package:studentsocial/presentation/screens/main/main_state.dart:35:32)
#3      MainState.getClickDate (package:studentsocial/presentation/screens/main/main_state.dart:35:32)
#4      MainState.getClickDate (package:studentsocial/presentation/screens/main/main_state.dart:35:32)
...
════════════════════════════════════════════════════════════════════════════════════════════════════
@tbm98 tbm98 added the bug Something isn't working label Jun 26, 2020
@tbm98
Copy link
Contributor Author

tbm98 commented Jun 26, 2020

sorry. my getter called itself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants