Search packages, repositories and app categories

Package detailsv1.0.0

is_first_run

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

AndroidiOSWebmacOSWindowsLinux
30-day downloads
2.5K
Likes
92
Pub points
160

Install package

flutter pub add is_first_run

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The is_first_run package provides a straightforward way to determine whether an application is being launched for the first time on a device. It uses shared preferences to store a flag indicating the app's run status, ensuring reliable detection across sessions. Ideal for initializing setup flows, displaying onboarding screens, or triggering first-time user actions. The package is lightweight and compatible with all major Flutter platforms, including mobile, web, and desktop. It requires no complex configuration and integrates seamlessly into existing projects.

Use cases

  • Onboarding screen display
  • First-time user setup
  • Initial data initialization
  • Welcome message delivery
  • Feature toggle activation

Key features

  • Simple API
  • Persistent state storage
  • Cross-platform support
  • No external dependencies
  • Easy integration

Suitable for

  • New app launches
  • User onboarding flows
  • Initial configuration tasks
  • Lightweight state tracking
  • Apps needing first-run logic

Considerations

  • Relies on shared preferences
  • Does not reset automatically
  • May require manual clearing
  • Limited to first-run detection
  • No built-in analytics

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package