Search
[Flutter/dart] null check operator used on a null value messaging
- M.R
- Mar 29, 2022
- 1 min read
Overview
A title error has occurred at FirebaseMessaging.onBackgroundMessage().
Cause and Solution
The delegate passed to the argument of the above method must be a top-level function. In my case, I was passing an instance method, so the error occurred.
The error disappeared when the method passed was a top-level function.
@main.dart
void main() async{
//・・・
FirebaseMessaging.onBackgroundMessage(onBackGround);
}
Future<void> onBackGround(RemoteMessage message)async{
//・・・
}
Comments