在 Onboard Pages 上進行 Flutter 應用程序初始化? (Flutter app initialization at Onboard Pages?)


問題描述

在 Onboard Pages 上進行 Flutter 應用程序初始化? (Flutter app initialization at Onboard Pages?)

我想在用戶安裝並啟動應用程序後接受用戶輸入。我想在他第一次使用應用程序時設置語言選擇、日期等參數。


參考解法

方法 1:

Use SharedPreferences

Have a page to take user inputs about your desired parameteres and ssave them in whereever you want to. While saving that, also store a boolean in SharedPref to indicate whether app is initialized or not.

In main() first you read this value from SharedPref. If the value is present then directly show your app's homepage else show the user input page.

This is similar to apps which have a login screen. In apps the login screen will appear only for the first time till user presses logout.

Check this package: SharedPreference

(by Sardar Badar SaghirSisir)

參考文件

  1. Flutter app initialization at Onboard Pages? (CC BY‑SA 2.5/3.0/4.0)

#flutter-packages #Flutter #flutter-dependencies #flutter-layout #flutter-navigation






相關問題

使用顫振包有缺點嗎? (Is there a downside for using flutter packages?)

導入 Http/http.dart 包時出錯 (error in importing Http/http.dart package)

flutter pub get 卡住了 (flutter pub get is stucking)

在 Onboard Pages 上進行 Flutter 應用程序初始化? (Flutter app initialization at Onboard Pages?)

Flutter + FlutterFire 版本根據遷移指南使用 firebase_messaging 解決失敗的 firebase_remote_config (Flutter + FlutterFire version solving failed firebase_remote_config with firebase_messaging as per migration guide)

無法在 iOS 模擬器上使用顫振圖像選擇器選擇圖像 (Unable to select image using flutter image picker on iOS simulator)

Flutter Package:未壓縮的包存檔太大 (Flutter Package : Uncompressed package archive is too large)

我可以知道是否有一個顫振包可以在照片和圖紙上做標記和註釋? (May I know is there a flutter package to do markups and annotations on photos and drawings?)

使用音頻播放器包時出現顫振錯誤 (Flutter error when using audioplayer packages)

Flutter 上的 lib 中沒有包選擇 (There isn't package selection in lib on Flutter)

運行“flutter pub get”時在 google_maps_flutter 上解決 Flutter 版本失敗 (Flutter version solving failed on google_maps_flutter while running "flutter pub get")

顫振中甜甜圈圖表中的最高值弧 (Highlist highest value arc in donut chart in flutter)







留言討論