How to move the application on background flutter?

Viewed 40

I want to move my application to background so i used the plugin move-to-background this is the code :

 onWillPop: () async {
          if (isDown == false) {
            Navigator.of(context).push(PageRouteBuilder(
                pageBuilder: (context, animation1, animation2) =>
                    const Home()));
            return false;
          } else {
           // MoveToBackground.moveTaskToBack();
            return false;
          }

but i want to use another way how can i do ? because when do build apk i get this warning :

/snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/move_to_background-1.0.2/android/src/main/java/com/sayegh/move_to_background/MoveToBackgroundPlugin.java:13: warning: [deprecation] Registrar in PluginRegistry has been deprecated
import io.flutter.plugin.common.PluginRegistry.Registrar;
                                          ^
snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/move_to_background-1.0.2/android/src/main/java/com/sayegh/move_to_background/MoveToBackgroundPlugin.java:24: warning: [deprecation] Registrar in PluginRegistry has been deprecated
  public static void registerWith(Registrar registrar) {
                                  ^
2 warnings
0 Answers
Related