To handle push notifications we are going to create a separate class . This class will initialize the FirebaseMessaging object, whose functions will be used to handle push notifications. Call this class from the initial widget’s initState() method so that we can initialize the FirebaseMessaging at the start.