Skip to content

Latest commit

 

History

History
78 lines (53 loc) · 2.04 KB

File metadata and controls

78 lines (53 loc) · 2.04 KB

move_to_background

pub package Flutter Android iOS

Flutter plugin for sending mobile applications to background. Supports iOS and Android.

✅ Compatible with Flutter 3.29.3 ✅ Supports Android API 16+ (targetSdk 34) ✅ Uses Flutter Embedding v2 ✅ AndroidX compatible

Getting Started

Install it (pubspec.yaml)

dependencies:
  move_to_background: ^1.0.3

Import it

import 'package:move_to_background/move_to_background.dart';

Use it

MoveToBackground.moveTaskToBack();

Useful Scenario

Use with WillPopScope to send your application to the background when the user attempts to exit the app.

WillPopScope(
  child: MaterialApp(...),
  onWillPop: () async {
    MoveToBackground.moveTaskToBack();
    return false;
  },
);

Requirements

Flutter

  • Flutter 3.0 or higher
  • Dart 2.17.0 or higher

Android

  • Android API level 16 (Android 4.1) or higher
  • Target SDK 34 (Android 14) for Google Play Store compliance
  • AndroidX support

iOS

  • iOS 9.0 or higher

Note about using it for iOS

Quitting your application or sending it to the background programmatically is a violation of the iOS Human Interface Guidelines, which usually doesn't bode well for getting through the review process. Keep that in mind.

Changelog

See CHANGELOG.md for a detailed list of changes.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.