is_first_run
앱이 처음 실행되었는지 확인하는 간단한 패키지입니다.
앱이 처음 실행되었는지 확인하는 간단한 플러터 패키지
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A simple package to check if it is the first time the app runs.
Internally it uses the shared_preferences plugin.
To use this plugin, add is_first_run as a dependency in your pubspec.yaml file.
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.
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().
Pull requests are always very welcome.
의존성 목록 3 개
{"sdk":"flutter"}^2.0.4{"sdk":"flutter"}사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗