hey guys when I use onDidReceiveBackgroundNotificationResponse in flutter_local_notification I got an error can someone help me?
actually I want navigate to second page after user select my notification in background mode but I got this problem
CodePudding user response:
put the definition of function used as backgroundHandler outside of any class.
ie for eg:
//if in main.dart
main(){
}
ClassABC{
void getLetter()=>print('a and b');
}
//notice how this is outside of classABC scope and main scope.
backgroundHandler(){
// put handling code here.
}
For more clarity, could you post the whole page code? if not clear.