title: Try correcting the name to the name of an existing method, or defining a method named 'configure'
body: <p>I got this error when I try to run flutter app.<br>
  The method 'configure' isn't defined for the type 'FirebaseMessaging'.
  Try correcting the name to the name of an existing method, or defining a method named 'configure'.</p>
  <pre><code>import 'dart:async';
  
  import 'package:firebase_messaging/firebase_messaging.dart';
  import 'package:flutter/cupertino.dart';
  import 'package:flutter/material.dart';
  import 'package:fluttertoast/fluttertoast.dart';
  import 'package:mvc_pattern/mvc_pattern.dart';
  
  import '../../generated/l10n.dart';
  import '../helpers/custom_trace.dart';
  import '../repository/settings_repository.dart' as settingRepo;
  import '../repository/user_repository.dart' as userRepo;
  
  class SplashScreenController extends ControllerMVC with ChangeNotifier {
    ValueNotifier&lt;Map&lt;String, double&gt;&gt; progress = new ValueNotifier(new Map());
    GlobalKey&lt;ScaffoldState&gt; scaffoldKey;
    final FirebaseMessaging firebaseMessaging = FirebaseMessaging();
  
    SplashScreenController() {
      this.scaffoldKey = new GlobalKey&lt;ScaffoldState&gt;();
      // Should define these variables before the app loaded
      progress.value = {&quot;Setting&quot;: 0, &quot;User&quot;: 0};
    }
  
    @override
    void initState() {
      super.initState();
      firebaseMessaging.requestNotificationPermissions(const IosNotificationSettings(sound: true, badge: true, alert: true));
      configureFirebase(firebaseMessaging);
      settingRepo.setting.addListener(() {
        if (settingRepo.setting.value.appName != null &amp;&amp; settingRepo.setting.value.appName != '' &amp;&amp; settingRepo.setting.value.mainColor != null) {
          progress.value[&quot;Setting&quot;] = 41;
          progress?.notifyListeners();
        }
      });
      userRepo.currentUser.addListener(() {
        if (userRepo.currentUser.value.auth != null) {
          progress.value[&quot;User&quot;] = 59;
          progress?.notifyListeners();
        }
      });
      Timer(Duration(seconds: 20), () {
        ScaffoldMessenger.of(scaffoldKey?.currentContext).showSnackBar(SnackBar(
          content: Text(S.of(state.context).verify_your_internet_connection),
        ));
      });
    }
  
    void configureFirebase(FirebaseMessaging _firebaseMessaging) {
      try {
        _firebaseMessaging.configure(
          onMessage: notificationOnMessage,
          onLaunch: notificationOnLaunch,
          onResume: notificationOnResume,
        );
      } catch (e) {
        print(CustomTrace(StackTrace.current, message: e));
        print(CustomTrace(StackTrace.current, message: 'Error Config Firebase'));
      }
    }
  
    Future notificationOnResume(Map&lt;String, dynamic&gt; message) async {
      print(CustomTrace(StackTrace.current, message: message['data']['id']));
      try {
        if (message['data']['id'] == &quot;orders&quot;) {
          settingRepo.navigatorKey.currentState.pushReplacementNamed('/Pages', arguments: 1);
        }
      } catch (e) {
        print(CustomTrace(StackTrace.current, message: e));
      }
    }
  
    Future notificationOnLaunch(Map&lt;String, dynamic&gt; message) async {
      String messageId = await settingRepo.getMessageId();
      try {
        if (messageId != message['google.message_id']) {
          if (message['data']['id'] == &quot;orders&quot;) {
            await settingRepo.saveMessageId(message['google.message_id']);
            settingRepo.navigatorKey.currentState.pushReplacementNamed('/Pages', arguments: 1);
          }
        }
      } catch (e) {
        print(CustomTrace(StackTrace.current, message: e));
      }
    }
  
    Future notificationOnMessage(Map&lt;String, dynamic&gt; message) async {
      Fluttertoast.showToast(
        msg: message['notification']['title'],
        toastLength: Toast.LENGTH_LONG,
        gravity: ToastGravity.TOP,
  //      backgroundColor: Theme.of(state.context).backgroundColor,
  //      textColor: Theme.of(state.context).hintColor,
        timeInSecForIosWeb: 5,
      );
    }
  }
  </code></pre>
  <p>Tried to change to initializeApp();
  Didn't Work.<br>
  flutter clean <br>
  flutter upgrade <br>
  flutter pub get <br>
  didn't work</p>
  <p><a href="https://i.stack.imgur.com/5BXe8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5BXe8.png" alt="Flutter Doctor" /></a></p>