Complete Flutter Application with Riverpod & Freezed + Dio for API REST

Overview

Flutter Crypto APP

Complete Flutter Application with Riverpod & Freezed + Dio for API REST.

test build codecov Flutter version GitHub license

Features

  • API REST (CryptoWatch)
  • Linear Graph View (Hour, Day, Week, etc)
  • OHLC Graph
  • Search
  • Light / Dark Theme
  • Multi Language
  • Exchange Selection
  • Favorite Pair

Stack

  • Flutter 2.2.0 (Null Safety)
  • Riverpod + Hooks
  • Freezed
  • Dio

Testing

  • Unit Testing (flutter_test)
  • Integration Testing (integration_test)
  • Mock Data (http_mock_adapter)
  • Github Actions (iOS & Android Integration Test)

Screenshots

Home Details Settings

Setup project

Download project

git clone https://github.com/salvadordeveloper/flutter-crypto-app

Get flutter dependencies

flutter pub get

You need to create an account at https://cryptowat.ch/ to get a personal API KEY

Rename the env.example file to .env and put there you API KEY

API_KEY={CryptoWatch_KEY}

Run the app

flutter run

If you have any error with generated files try to run this

flutter pub run build_runner build --delete-conflicting-outputs

Testing

Unit Test

flutter test

Integration Test

flutter drive --driver=test_driver/integration_test.dart --target=integration_test/main_test.dart

Resources

Flutter Docs

Riverpod Docs

Cryptowatch Docs

Licence

MIT License

Copyright (c) 2021 Salvador Valverde

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
You might also like...

🎯 This library automatically generates object classes from JSON files that can be parsed by the freezed library.

🎯 This library automatically generates object classes from JSON files that can be parsed by the freezed library.

The Most Powerful Way to Automatically Generate Model Objects from JSON Files ⚡ 1. Guide 🌎 1.1. Features 💎 1.1.1. From 1.1.2. To 1.2. Getting Starte

Nov 9, 2022

FLutter Api Integration - Flutter Rest API Integration

FLutter Api Integration - Flutter Rest API Integration

Flutter_Rest_Api_integration Flutter_Rest_Api_integration. Preview How To Use To

Feb 17, 2022

Movie API Use Rest And Restful API

Movie API Use Rest And Restful API

movie_api use rest and restful api The home screen fetches data from the Episodate API and shows a list of popular shows. The details screen and the s

Dec 5, 2022

Netflix app UI clone using bloc,Rest API and TMDB for API key

netflix_flutter project_using_bloc packages Used flutter_bloc json_serializable get_it dio A few resources to get you started if this is your first Fl

Nov 25, 2022

API call using Dio package and GetX in Flutter.

API call using Dio package and GetX in Flutter.

API call demo This demo is to get API data using Dio package and I have also used GetX package for state management. I have implemented two ways to di

Dec 11, 2022

Flutter table with dio and provider - A flutter Application created for Portfolio Page

Flutter table with dio and provider - A flutter Application created for Portfolio Page

My LinkedIn https://www.linkedin.com/in/marcelo-augusto-a60b6821a/ Intro This is

Jan 18, 2022

Flutter Viral News App using : Flutter + Rest Api + Bloc / Cubit

Flutter Viral News App using : Flutter + Rest Api + Bloc / Cubit

Intro Viral News App on Flutter. The tech used: Flutter widgets + Flutter Bloc / Cubit + Rest Api Check the screenshot : P.S Make sure to upgrade your

Nov 2, 2022

Flutter-for-Wordpress-App - Cross platform wordpress news app built with Flutter and WP REST API

Flutter-for-Wordpress-App - Cross platform wordpress news app built with Flutter and WP REST API

Flutter for Wordpress A flutter app for a wordpress websites with clean and elegant design. This app is available in free and pro version. You can cho

Dec 23, 2022

Flutter ios/android app to get posts from Wordpress Rest Api

Flutter ios/android app to get posts from Wordpress Rest Api

A Wordpress client for Flutter This project uses a simple WordPress website as a backend, without any additional plugin. for more information about Wo

Dec 28, 2022
Comments
  • Exception has occurred. DataException (errorBadRequest)

    Exception has occurred. DataException (errorBadRequest)

    Hello! I tried to run your code but it gives me the following error:

    
    Exception has occurred.
    DataException (errorBadRequest)
    

    The error occurs in this part of the code:

    
    final favoritePairProvider = FutureProvider<FavoritePair>((ref) async {
      final cancelToken = CancelToken();
      ref.onDispose(() => cancelToken.cancel());
    
      final settings = ref.watch(cryptoSettings);
      String exchangeName = settings.maybeWhen(
          data: (details) => details.favoriteExchange, orElse: () => "");
      String pairName = settings.maybeWhen(
          data: (details) => details.favoritePair, orElse: () => "");
    
      if (exchangeName.isEmpty || pairName.isEmpty) {
        throw DataException(message: LocaleKeys.errorSomethingWentWrong);
      }
    
      Pair pair = Pair(pair: pairName, exchange: exchangeName);
      try {
        PairSummary pairSummary = await ref
            .read(cryptoRepository)
            .getPairSummary(exchangeName, pairName, cancelToken: cancelToken);
        return FavoritePair(pair: pair, pairSummary: pairSummary);
      } on DataException catch (error) {
        if (error.message == LocaleKeys.errorRequestNotFound) {
          ref.read(cryptoSettings.notifier).verifyFavoritePair();
        }
        throw error;
      }
    });
    

    I also changed the .env-example file to .env and copied my gotten API private key like below into it:

    API_KEY=ddTaK3jVw5fgdfgdgfdgfgfdgfdgfd

    Do you know how can I fix it?

    opened by Zohalmohal 0
Owner
Xtenso
Xtenso
Getx and Dio APi-Integration - Flutter RestApi Integration using Dio

Flutter RestApi Integration using Dio. Click this image to find videos==> //Crud

Fsd Ramjan 9 Nov 5, 2022
Developed using Dart & Flutter & Rest Api & Dio & Bloc & SharedPreferenes.

This is an ecommerce app which contain Many features like : Sign in , Sign up , Verify Email , log out. Fetch Products Data Search for any product Add

Mohamed Hashim 4 Nov 3, 2022
A boilerplate project for Flutter using RiverPod, Dio, auto_route

Flutter Boilerplate A boilerplate project for Flutter using RiverPod, Dio, auto_route, Freezed and generated with very_good_cli. This is a very simple

Gildo Jr 9 Dec 9, 2022
Riverpod Messages Listener: A message notification listener for apps build with Riverpod

Riverpod Messages Listener Hello all, this is the home page of riverpod_messages package, a message notification listener for apps build with Riverpod

Fabrizio Tognetto 4 Dec 8, 2022
Bhagavad Gita app using flutter & Bhagavad-Gita-API is A lightweight Node.js based Bhagavad Gita API [An open source rest api on indian Vedic Scripture Shrimad Bhagavad Gita].

Gita Bhagavad Gita flutter app. Download App - Playstore Web Application About Bhagavad Gita app using flutter & Bhagavad-Gita-API is A lightweight No

Ravi Kovind 7 Apr 5, 2022
Complete Implementation of Google maps in Flutter using Riverpod

Complete Implementation of Google maps in Flutter using Riverpod (Google Maps ft. Auto Suggestions, GPS tracking, Nearby places, polylines, directions, Review, Contact Details & Photos of a place and much more..)

Akash Mishra 10 Dec 31, 2022
In this video we will learn how to Create CRUD Rest API for our Flutter application using NODEJS API.

Flutter CRUD Using NodeJS API In this video we will learn how to Create CRUD Rest API for our Flutter application using NODEJS API. ?? Packages Used h

SnippetCoder 14 Dec 30, 2022
A rewrite of Bloc tutorial: Flutter Weather Tutorial using freezed

A rewrite of Bloc tutorial: Flutter Weather Tutorial using freezed. Bloc was used instead of Cubit (Cubit vs Bloc)

Yu-Han Luo 17 Nov 23, 2022
A Flutter Result type that feels like a Freezed union.

Freezed Result A Result<Success, Failure> that feels like a Freezed union. It represents the output of an action that can succeed or fail. It holds ei

Day Logger, Inc. 2 Nov 24, 2022