Skip to main content

Auto Login between Switch Flavor

What is Auto Login?

Auto Login Between Switch Flavor is a feature that allows users to remain logged in automatically when they switch between different versions or "flavors" of an application. "Switch flavor" literally means "changing taste" or "changing variant." In the context of technology or application development, "flavor" refers to different variants or versions of an application or software. For example, in an application that has a standard version and a premium version, Auto Login Between Switch Flavor ensures that users who have logged in to one version do not need to re-login when switching to another version. This enhances user convenience by reducing the need to log in repeatedly.

The Purpose of Using Auto Login

The Auto Login Between Switch Flavor feature is designed to streamline the development process for mobile engineers, specifically within Visual Studio Code. With this feature, you no longer need to manually re-login every time you switch between different launch modes such as Staging and Production.

Technical Background

Flowchart

Folder and File Structure

lib
├── controllers
| └── new_controller
| ├── auth_new.dart
| ├── spf_C.dart
| └── splash_c.dart
├── models
│ ├── flavor_m.dart
│ └── login_method_m.dart
├── new
│ └── new_route.dart
├── constants.dart
├── main_prod.dart
└── main_stag.dart
#File NameDescription
1constants.dartStore launch value type (production and staging).
2main_prod.dartFile utama yang berisi entry point untuk autologin tipe launch production.
3main_stag.dartFile utama yang berisi entry point untuk autologin tipe launch staging.
4new_route.dartrouting, secara detail didalamnya mengeksekusi splash_c.dart to run
5flavor_m.dartflavor model
6login_method_m.dartlogin method model
7splash_c.darttrigerred by new_route.dart mengatur flow UI/UX berdasarkan 2 if conditional di authlogin // prev flavor //
8spf_C.dartget and store 2 if conditional data flavortype and login method (``)
9auth_new.dartinti dari fitur autologin, main function code

How To

  1. Run the simulator, for example, run the Staging launch mode.
  2. Do login. Using Arkademi/Facebook/Apple/Google account.
  3. Click the 'Stop' button (red square icon) on the debug toolbar to stop the simulator.
    caution

    Before switching any launch mode, it is essential to stop the current launch mode app to avoid conflicts.

    stop button
  4. Change the launch type to Production. change launch
  5. Start the simulator. start simulator
  6. Wait, the simulator has to reload the application and then you will see the application autologin
    tip

    Depicting the loading screen indicating the state where the app is performing auto-login for the new launch type.

    reload app
  7. Done! Now you can use each launch without login.

Written by Kai and Media
Mei 2024