FLUTTER ECOSYSTEM

ExtraSettings/move_to_background

用於將應用程式發送到背景的 Flutter 插件

移至背景 專案封面
Stars
28
Forks
84
最近推送(UTC)
2024年2月7日
專案狀態
未封存
ExtraSettings GitHub avatar
語言JavaRubyDartObjective-C

技術主題

使用的依賴

依賴清單 2 項
  • flutter{"sdk":"flutter"}
  • flutter_test開發依賴{"sdk":"flutter"}

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

move_to_background

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

Getting Started

Install it (pubspec.yaml)
move_to_background: <latest>
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;
  },
);

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.