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

パッケージ詳細v1.0.0

is_first_run

アプリが初めて実行されたかどうかを確認するための簡単なパッケージ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2680
いいね数
92
Pub ポイント
160

パッケージをインストール

flutter pub add is_first_run

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

is_first_run パッケージは、アプリケーションがデバイス上で初めて起動されているかどうかを簡単に判断する方法を提供します。共有設定を使用して、アプリの実行状態を示すフラグを保存し、セッション間で信頼性の高い検出を保証します。セットアップフローの初期化、オンボーディング画面の表示、初回ユーザー操作のトリガーに最適です。このパッケージは軽量で、モバイル、Web、デスクトップを含むすべての主要なFlutterプラットフォームと互換性があります。複雑な設定は必要なく、既存のプロジェクトにスムーズに統合できます。

用途

  • オンボーディング画面表示
  • 初めてのユーザー設定
  • 初期データの初期化
  • ウェルカムメッセージの配信
  • 機能トグルの有効化

主な機能

  • シンプルな API
  • 永続的状態ストレージ
  • クロスプラットフォーム対応
  • 外部の依存関係なし
  • 簡単な統合

適している対象

  • 新しいアプリのリリース
  • ユーザーのオンボーディングフロー
  • 初期設定タスク
  • 軽量な状態トラッキング
  • 初回実行ロジックを必要とするアプリ

注意事項

  • 共有設定に依存しています
  • 自動でリセットされません
  • 手動でクリアする必要がある場合があります
  • 初回実行検出に限定
  • 組み込みのアナリティクスなし

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

is_first_run

A simple package to check if it is the first time the app runs.

Internally it uses the shared_preferences plugin.

Getting Started

To use this plugin, add is_first_run as a dependency in your pubspec.yaml file.

Usage

Import is_first_run.dart:

import 'package:is_first_run/is_first_run.dart';

To check if this is the first time the app is run:

bool firstRun = await IsFirstRun.isFirstRun();

If it is the first call of this method since installing the app, the method will return true for as long as the app keeps running.After a restart of the app it returns false.

There is also a method that allows you to check if it is the first time you call it:

bool firstCall = await IsFirstRun.isFirstCall();

Calling this function for the first time after installing the app returns true, after that every function call returns false.

You can reset the plugin by calling

await IsFirstRun.reset();

After calling reset(), calling isFirstRun() will return true as long as the app is running. After a restart, it will return false again. The first call of isFirstCall() will return true, subsequent calls will return false again.

Example

The example is a simple page showing you the result of the function IsFirstRun.isFirstRun(). A button allows you to call IsFirstRun.isFirstRun() again, the reset button calls IsFirstRun.reset().

Maintainers

Pull requests are always very welcome.

カテゴリー

依存関係

依存関係一覧 1 件

ソースリポジトリ

このパッケージを使用しているプロジェクト