Skip to content

Authentication

ShipFlutter uses Firebae Authentication as a backend, offering a set of authentication methods that you can use to authenticate your users, in addition to a responsive login page that handles social signin, email-password, anonymous auth, as well as verification and recover flow.

The authentication module is structured in the following way:

  • Directoryapp/lib/modules/auth
    • auth_view.dart // Responsive login page
    • auth_dialog.dart // Utility dialogs (e.g recover password)
    • auth_route.dart // Navigation logic
    • auth_controller.dart // Business logic and state
    • auth_service.dart // Connector to the Firebase Auth Backend
    • credentials.dart // Model class with user auth data
    • credentials_controller.dart // Observes changes in the credentials

Setup

Before starting, make sure you have completed the prerequisites and the Firebase setup steps.

Enable Firebase Authentication

  1. Open the associated Firebase Project dashboard.
  2. Under Build > Authentication > Sign-in Method tab.
  3. Enable Email/Password and Anonymous by adding them as providers
  4. Run the app and try to create a new user. It should work :)