Coder Social home page Coder Social logo

salvadordeveloper / flutter-crypto-app Goto Github PK

View Code? Open in Web Editor NEW
400.0 9.0 97.0 2.6 MB

Flutter Cryptocurrency App with Riverpod & Freezed + Dio for API REST

License: MIT License

Shell 0.20% Kotlin 0.12% Dart 94.58% Ruby 1.22% Swift 0.36% Objective-C 0.03% HTML 3.48%
flutter riverpod app githubactions freezed flutter-apps flutter-demo flutter-ui

flutter-crypto-app's Introduction

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.10.2
  • 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) 2022 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.

flutter-crypto-app's People

Contributors

anshmishra010 avatar salvadordeveloper avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-crypto-app's Issues

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?

Add a close button to the search bar

When the user enters the search content, they can click the close button to quickly clear the search content to improve user experience.
Screenshot_20220630-050119

You can consider using ConsumerStatefulWidget to achieve this function.
2022-06-30_045739
2022-06-30_045924

[Security] Workflow release.yml is using vulnerable action actions/checkout

The workflow release.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

SearchScreen doesn't show CircularProgressIndicator first

When SearchScreen requests network data, it first displays No results.
Screenshot_20220626-212147

Because the list is initialized by default, if the network data is not loaded, the returned list will cause data.length to be 0, and then display No results.
So consider trying not to initialize the list and let it return null.
2022-06-26_215549

Then consider displaying CircularProgressIndicator when data == null.
And when data.length == 0, displays No results.
2022-06-26_215740

Error: A value of type 'ListTileThemeData' can't be assigned to a variable of type 'ListTileTheme'. -

/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/settings_ui-1.0.0/lib/src/cupertino_settings_item.dart:76:51: Error: A value of type 'ListTileThemeData' can't be assigned to a variable of type 'ListTileTheme'.

  • 'ListTileThemeData' is from 'package:flutter/src/material/list_tile.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/material/list_tile.dart').
  • 'ListTileTheme' is from 'package:flutter/src/material/list_tile.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/material/list_tile.dart').
    final ListTileTheme tileTheme = ListTileTheme.of(context);
    ^

[Security] Workflow tests.yml is using vulnerable action actions/checkout

The workflow tests.yml is referencing action actions/checkout using references v1. However this reference is missing the commit a6747255bd19d7a757dbdda8c654a9f84db19839 which may contain fix to the some vulnerability.
The vulnerability fix that is missing by actions version could be related to:
(1) CVE fix
(2) upgrade of vulnerable dependency
(3) fix to secret leak and others.
Please consider to update the reference to the action.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.