Covid tracker - Covid Tracker app using Flutter

Overview

Covid Tracker


discord flutter issues forks Lisence stars

Architecture

The covid tracker app is used to demonstrate the use of MVVM architecture and clean architecture. The architecture of the app is like the following diagram:

architecture

To get more into specifics, in the application the Provider state management is used, therefore it is easy to implement the MVVM since the Provider has a class called ChangeNotifierProvider.

First we have the View, which can be any screen or widgets and the only function of the View is to show the data on the screen. Then we have the ViewModel classes which can extend the ChangeNotifier class or use it as a mixin, doing that will allow us to use the method notifyListener() which will notify the ChangeNotifierProviders for any change, so the ViewModel here does not have access to the View instead when notifyListener() is called, all the objects that are subscribed will be notified of the changes. So this is like the observer pattern.

Then we go to the Model part but before explaining that, in the application also I'm using the package get_it which is a service locator which means you would have a central registry where you can register the classes and then obtain an instance of those class. Therefore, since I don't want the ViewModel classes to know the implementation used in the Repository then I use an abstract class and using the get_it package I can register the implementation class. But the ViewModel classes will always depend on the abstraction instead of the implementation and this will make it easier if you want to change the implementation later on. For example inside the VaccinationViewModel:

  final VaccinationViewRepository _repository = locator<VaccinationViewRepository>();

Here, the class registered is VaccincationViewRepositoryImpl inside service_locator.dart but the VaccinationViewModel will have a dependency on VaccinationViewRepository thus implementing the 'D' part in SOLID principles.

Therefore the ViewModel class will call the Repository which will also call the Service classes, in my case here I used retrofit which will lead to many generated files but you can just use Dio instead of retrofit. When the data is obtained, it is then returned through each layer from the Service classes until the ViewModel which calls notifyListener() to notify the View of the changes.

Finally, I seperated the files by feature instead of adding all the ViewModel under a folder called ViewModel and all the Services under a folder called Services... this way it will be easier for navigation.

The API that is used in the application can be found here: https://disease.sh/docs/

structure

Screens

World Stats Screen 1 World Stats Screen 2 Search Screen 1
worldstats worldstats search
Search Screen 2 Country Stats Screen Vaccine Screen
search stats vaccine
Country Stats Screen 2

How To Run

If you fork the project, then all you have to do is download the dependencies first which you can by executing the command:

flutter pub get

And then execute:

flutter pub run build_runner build

To generate all the auto-generated files. Also since Google maps is used, then you need to get an API key to add it to the Android_manifest.xml file. For example:

<application
  ....
<meta-data android:name="com.google.android.geo.API_KEY"
  android:value="API_KEY_HERE"/>
  ....
  </application>

License

Licensed under the MIT License.

Helpful Articles

Provider Implementation Guide
Using GetIt in Flutter
Making Sense of all those Flutter Providers
Clean Architecture for the rest of us
Using Provider in Flutter

Support!

Support the repository by joining the stargazers for this repo

Created & Maintained By

Peter (@peterndev)

If you found this project helpful or you learned something from the tutorials and want to thank me, consider buying me a cup of

Buy Me A Coffee

You might also like...

Time Tracker App Login With Flutter And Firebase

Time Tracker App Login With Flutter And Firebase

APP TIME TRACKER COM LOGIN FIREBASE Aplicativo em Dart e Flutter desenvolvido co

Mar 25, 2022

Conference Tracker Management app written in Flutter.

Conference Tracker Management app written in Flutter.

Conference Tracker Management This is a Flutter project for tracking conferences and generating a schedule from input. The conference has multiple tra

Jan 8, 2022

Corona Virus Tracker & Advices App with Flutter

Corona Virus Tracker & Advices App with Flutter

Corona Virus Tracker & Advices App with Flutter Try the web app dev preview https://alfian-flutter-coronatracker.firebaseapp.com/ Features Current sta

Dec 19, 2022

Expense tracker - Build an app in flutter that can record the transaction we make in our daily life

Expense tracker - Build an app in flutter that can record the transaction we make in our daily life

expense_tracker I tried to build an app in flutter that can record the transacti

Nov 6, 2022

A cryptocurrency tracker and portfolio app, built with Flutter and Dart

A cryptocurrency tracker and portfolio app, built with Flutter and Dart

I'm currently rewriting the application from scratch to remove a lot of the ugly code, conform better to modern flutter best practices with regards to

Oct 6, 2022

This is a Clone FinkuApp Inspired by This Real App It Self, Finku is a Money Management Tracker Develop by Fintech

This is a Clone FinkuApp Inspired by This Real App It Self, Finku is a Money Management Tracker Develop by Fintech

📦 Finku App This is a Clone FinkuApp Inspired by This Real App It Self, Finku is a Money Management Tracker Develop by Fintech. 🎖 Installing depende

Dec 16, 2022

Itacov-flutter - Aplikasi Indonesia Tanggap Covid-19 (Made With Flutter)

ITACOV 🗺 Sebuah project aplikasi mobile open source made with flutter, di harapkan dapat membantu untuk mencegah penyebaran Covid-19 Mau Ikut ? Desig

Jun 28, 2022

COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with JSON.

COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with JSON.

Covid App COVID-19 application made with Flutter, following Test Driven Development (TDD) and Clean Architecture along with Internationalization with

Aug 4, 2022

Flutter's application that provides information about Covid-19 in Indonesia

Flutter's application that provides information about Covid-19 in Indonesia

Info Covid-19 Flutter's application that provides information about Covid-19 in Indonesia Report Bug · Request Feature Table of Contents About the Pro

Dec 23, 2021
It's a very simple COVID-19 Tracker app.

COVID19 Tracker App It's a dedication to my closest friend who has been tested positive for COVID. Please take care of yourself and your family. Stay

Muhammad Hamza 48 Nov 17, 2022
Workout Tracker App built using Flutter and Dart. The app is available on PlayStore

Workout Tracker App built using Flutter and Dart. The app is available on PlayStore

SahilShah 2 Jun 21, 2022
Covid-19 Care App Using Flutter

Tên dự án: App Covid Care Thực trạng: + Tình trạng dịch bệnh diễn ra phức tạp. + Số lượng bệnh nhân quá đông. + Tình trạng quá tải của các bệnh viện.

null 2 Jun 9, 2022
🦠 nCovid19 Tracker built using Flutter

nCovid19-tracker nCovid19 Tracker built using Flutter & Coronavirus Tracker API. Screeshots Web PWA Android Linux Dependencies flutter_bloc http built

Tirth 27 Nov 17, 2022
A covid statistics app made with Flutter SDK

Covid Tracker - A covid-19 statistics app Covid Tracker is an app made with Flutter framework to provide worldwide information related to Covid-19 pan

Abdur Rafay Saleem 82 Dec 1, 2022
An online query App for COVID-19 statistics developed by Flutter was used.

如果产生其他依赖无法编译的问题,可以尝试将pubspec.yaml中的dependencies中的所有依赖的"^"去掉,重新编译尝试。 nCoV_2019 获取新肺炎实时动态App,支持Android和IOS。 Log 2020.09.03 - 适配Flutter 1.20 2020.07.04 -

FlutterCandies 261 Dec 11, 2022
CovidApp - A simple and minimal UI design COVID APP made with Flutter

covid_app A simple and minimal UI design COVID APP made with Flutter UI

Mohammed Thalha 0 Feb 5, 2022
A cross platform-app made with flutter of latest updates of Covid-19

Covid Updates A Flutter project inspired by @tmrw. Download app Android IOS Download the zip from the latest master action Extract the ipa App will re

Ashish Khuraishy 98 Nov 23, 2022
CoVAC is an all-in-one Covid info toolkit app, providing users the facility to check for available slots along with receiving the latest updates related to the pandemic and the virus.

CoVAC - Covid 19 Vaccine Availability Checker Introduction ?? CoVAC is an android application developed to provide users the facility to check the ava

Aryan Kenchappagol 6 Dec 29, 2021
A beautiful 😍 covid-19 app with self - assessment and more.

Aarogya Seva Made with ?? in India ?? Aarogya Seva is an Indian app developed using flutter for tracking live Covid-19 cases. App provides Coronavirus

Shubham Soni 118 Nov 25, 2022