I am working on a flutter application and I am trying to convert this arrow function to a normal one, but it is not working
_firebaseMessaging.getToken().then((value) => print('Token: $value'));
Can someone help me with it please ?
I am working on a flutter application and I am trying to convert this arrow function to a normal one, but it is not working
_firebaseMessaging.getToken().then((value) => print('Token: $value'));
Can someone help me with it please ?
Try this(what I recommend ):
var result = await _firebaseMessaging.getToken();
print('Token: $result');
or this:
_firebaseMessaging.getToken().then((value){
print('Token: $value')
});
This might help you
_firebaseMessaging.getToken().then((value){
print('Token: $value');
}));