Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev1.0.0

is_first_run

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

AndroidiOSWebmacOSWindowsLinux
Downloads em 30 dias
2,7 mil
Curtidas
92
Pontos Pub
160

Instalar pacote

flutter pub add is_first_run

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

O pacote is_first_run fornece uma maneira simples de determinar se um aplicativo está sendo iniciado pela primeira vez em um dispositivo. Ele usa preferências compartilhadas para armazenar uma bandeira indicando o status de execução do aplicativo, garantindo detecção confiável entre sessões. Ideal para inicializar fluxos de configuração, exibir telas de introdução ou acionar ações para usuários pela primeira vez. O pacote é leve e compatível com todas as principais plataformas Flutter, incluindo móvel, web e desktop. Não requer configuração complexa e se integra perfeitamente em projetos existentes.

Casos de uso

  • Exibição da tela de onboarding
  • Configuração do usuário pela primeira vez
  • Inicialização de dados iniciais
  • Entrega da mensagem de boas-vindas
  • Ativação do interruptor de recurso

Principais recursos

  • API simples
  • Armazenamento de estado persistente
  • Suporte multiplataforma
  • Sem dependências externas
  • Integração fácil

Indicado para

  • Novo lançamento de aplicativo
  • Fluxos de onboarding do usuário
  • tarefas de configuração inicial
  • Rastreamento leve de estado
  • Aplicativos que precisam de lógica de primeira execução

Considerações

  • Depende das preferências compartilhadas
  • Não é redefinido automaticamente
  • Pode exigir limpeza manual
  • Limitado à detecção de primeira execução
  • Sem análise integrada

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

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.

Categorias

Dependências

Lista de dependências 1 itens

Repositório-fonte

Projetos que usam este pacote