Buscar pacotes, repositórios e categorias de apps

Repositório GitHubJulianAssmann/flutter_is_first_run

flutter_is_first_run

Um pacote simples do Flutter para verificar se é a primeira vez que o aplicativo está sendo executado

Capa do projeto flutter_is_first_run
Estrelas
10
Forks
3
Último push (UTC)
20 de jul. de 2022
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

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.

Julian Aßmann GitHub avatar
Autor no GitHub

Julian Aßmann ↗

PhD Candidate in Sustainable AI @SAP and the University of Manheim

@SAPHeidelberg, GermanySite oficial ↗
LinguagensDartSwiftKotlinObjective-C

Categorias

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 3 itens

  • flutter{"sdk":"flutter"}
  • shared_preferences^2.0.4
  • flutter_testDesenvolvimento{"sdk":"flutter"}

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

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

GitHub Docs — About repositories ↗