Testing provider in Flutter

Aseem Wangoo
CodeChai
Published in
4 min readNov 3, 2019

--

Testing provider in Flutter

How to test providers in Flutter, hmmm….

All in one Flutter resource: https://flatteredwithflutter.com/testing-provider-in-flutter/

Installing provider,

Put this dependency in your pubspec.yaml.

provider: ^3.1.0+1 // as of now

Begin Testing…

Testing provider in Flutter

Pre-requisite :

Install build_runner, json_serializable and json_annotation….

Note : Please place the packages as advised in the respective links..

Also, you need to be in flutter channel : stable and version :Flutter 1.9.1+hotfix.6

1. Create a Model class…

We have created a simple model class called Location….

part 'location.g.dart';@JsonSerializable()
class Location {
//
Location({
this.city,
this.country,
this.countryName…

--

--