Flutter Thursday 13: Building a User Registration and Login Process with provider and external API

This episode will build a user registration and authentication system that will interface with a backend system. It will cover the following flows: registration, login, auto-login, and logout. We will use the provider package to maintain state and the backend will be a Phoenix application (you can use any web service of your choice).

Start

Let’s create a new flutter project called jada

flutter create jadacd jada

We would need the provider package; add the following to your pubsec.yaml file

dependencies:   
  provider: ^4.3.1

Install the package using flutter pub get and we can subsequently use it in our project as import ‘package:provider/provider.dart’; We would talk more about the provider later in the article.

We would also need to make HTTP calls and persist data locally, so add two additional packages to pubsec.yaml as well.

Website

Tags: API external