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

Notification Error #24

Closed
gulmensedat opened this issue Apr 30, 2020 · 17 comments
Closed

Notification Error #24

gulmensedat opened this issue Apr 30, 2020 · 17 comments

Comments

@gulmensedat
Copy link

════════ Exception caught by scheduler library ═════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
Tried to listen to a value exposed with provider, from outside of the widget tree.

This is likely caused by an event handler (like a button's onPressed) that called
Provider.of without passing listen: false.

To fix, write:
Provider.of(context, listen: false);

It is unsupported because may pointlessly rebuild the widget associated to the
event handler, when the widget tree doesn't care about the value.

The context used was: HomePage(dependencies: [_DefaultInheritedProviderScope], state: _HomePageState#074c3)
'package:provider/src/provider.dart':
Failed assertion: line 193 pos 7: 'context.owner.debugBuilding || listen == false || _debugIsInInheritedProviderUpdate'

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md

When the exception was thrown, this was the stack:
#2 Provider.of (package:provider/src/provider.dart:193:7)
#3 _HomePageState._checkNotification. (package:twitterapp2/page/homePage.dart:86:28)
#4 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
#5 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1049:9)
#6 SchedulerBinding.scheduleWarmUpFrame. (package:flutter/src/scheduler/binding.dart:850:7)
...

@TheAlphamerc
Copy link
Owner

Which version of flutter SDK you are using ?

@gulmensedat
Copy link
Author

Which version of flutter SDK you are using ?

v1.12.13+hotfix.9
v1.16.3
v1.16.2

@TheAlphamerc
Copy link
Owner

Do you have the latest code pull?

@gulmensedat
Copy link
Author

I got this error after reinstalling it. I think the reason I got this error is because I did not set the notification correctly. I couldn't find how to produce Key.

@TheAlphamerc
Copy link
Owner

Please answer below queries first.

  1. Do you have latest project code on your system?
  2. Are you talking about FCM server key ?

@gulmensedat
Copy link
Author

  1. Has the most current version.
  2. Yes.

@TheAlphamerc
Copy link
Owner

To get information about FCM key please check this issue

@gulmensedat
Copy link
Author

To get information about FCM key please check this issue

key okey.

@gulmensedat
Copy link
Author

In the latest project codes, the member opens the register, but nothing in the database.

@TheAlphamerc
Copy link
Owner

I didn't get you. Can you explain it what are you trying to say?

@gulmensedat
Copy link
Author

I didn't get you. Can you explain it what are you trying to say?

I say create an account
Authentication occurs
Nothing happens in the database

@TheAlphamerc
Copy link
Owner

Please share error console logs

@gulmensedat
Copy link
Author

Please share error console logs

I solved the problem, I did not realize that there was a problem of rules.

@gulmensedat
Copy link
Author

But I'm still getting this error.

════════ Exception caught by scheduler library ═════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
Tried to listen to a value exposed with provider, from outside of the widget tree.

This is likely caused by an event handler (like a button's onPressed) that called
Provider.of without passing `listen: false`.

To fix, write:
Provider.of<NotificationState>(context, listen: false);

It is unsupported because may pointlessly rebuild the widget associated to the
event handler, when the widget tree doesn't care about the value.

The context used was: HomePage(dependencies: [_DefaultInheritedProviderScope<AppState>], state: _HomePageState#db1af)
'package:provider/src/provider.dart':
Failed assertion: line 193 pos 7: 'context.owner.debugBuilding || listen == false || _debugIsInInheritedProviderUpdate'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=BUG.md

When the exception was thrown, this was the stack: 
#2      Provider.of (package:provider/src/provider.dart:193:7)
#3      _HomePageState._checkNotification.<anonymous closure> (package:twitterapp2/page/homePage.dart:86:28)
#4      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1102:15)
#5      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1049:9)
#6      SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:850:7)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

@TheAlphamerc
Copy link
Owner

Add below provider version in pubspec.yml
provider: ^3.2.0

@TheAlphamerc
Copy link
Owner

@gulmensedat is it works?

@gulmensedat
Copy link
Author

is it works?

yes thanks.

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

2 participants