パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリThe-ring-io/flutter_phoenix

flutter_phoenix

簡単にアプリケーションを最初から再起動できます。

flutter_phoenix のプロジェクト画像
スター
156
フォーク
20
最終プッシュ(UTC)
2023/11/20
プロジェクト状態
公開中

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

Flutter Phoenix

Easily restart your application from scratch, losing any previous state.

Flutter 3.0

From 1.1.0 and onwards, flutter_phoenix is targeting SDK 2.17.0 minimum. If you want to keep using flutter_phoenix but cannot migrate to Dart SDK 2.17.0 yet, use the version 1.0.0 instead.

Flutter 2.0 and null-safety

From 1.0.0 and onwards, flutter_phoenix is null-safe and requires Dart SDK 2.12.0 minimum.

If you want to keep using flutter_phoenix but cannot migrate to null-safety yet, use the version 0.1.0 instead.

Usage

Wrap you App widget in the Phoenix widget.

void main() {
  runApp(
    Phoenix(
      child: App(),
    ),
  );
}

Call the rebirth static method when you want to restart your application (rebuild the entire widget tree from scratch).

Phoenix.rebirth(context);

Disclaimer :

Phoenix restarts your application at the application level, rebuilding your application widget tree from scratch, losing any previous state.

Phoenix does not fully restart your application process at the OS level.

Use cases

Here is a non-exhaustive list of use cases where Phoenix can help :

  • restart the app after a logout
  • restart the app after a failed app initialization process
  • restart the app after a specific event in the app occurs
  • ...

Installation

Dependency

Add the package as a dependency in your pubspec.yaml file.

dependencies:
  flutter_phoenix: "^1.0.0"
Import

Import the package in your code file.

import 'package:flutter_phoenix/flutter_phoenix.dart';

License

Flutter Phoenix is released under the MIT License

Credit

This package is an extract of @rrousselGit answer on this stackoverflow post

About us

As of July 2022, this package is maintained by the front team working on the french mobile application Dailyn

Dailyn GitHub avatar
GitHub 作者

Dailyn ↗

言語DartSwiftKotlinObjective-C

使用している依存関係

依存関係一覧 2 件

  • flutter{"sdk":"flutter"}
  • flutter_test開発用{"sdk":"flutter"}

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗