Made with Clean architecture + TDD + GraphQL + flutter_bloc + CodeCov + GitHooks + GitHub Actions (CI/CD) and finally with 💙

Overview

Rick and Morty Info

Actions Status Actions Status codecov Flutter version style: effective dart License: MIT

A simple app to demonstrate Clean Architecture with GraphQL and flutter_bloc

Motivation

In Martin Fowler's words,

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” (Refactoring: Improving the Design of Existing Code, 1999, p. 22)

With this idea in mind, I wanted to demonstrate how we can make a simple app in production grade (and I hope I made my case).

"Production level" implementations

Screenshots

Screen 1 Screen 2 Screen 3

Installation

  • Check if you are in the beta channel of flutter SDK and the version v2.0.1 or higher. Instruction to change flutter channel.
  • Clone the repo
    git clone https://github.com/excogitatr/rick-and-morty-info.git
  • And then we can use the normal build and run procedure
    flutter pub get
    flutter run
  • Some files like *.freezed.dart, *.g.dart, *.iconfig.dart are auto generated. If there is any issue from these files just run this command to regenerate them.
    flutter pub run build_runner watch --delete-conflicting-outputs

Thanks to

  • unclebob (For the infamous Clean Architecture)
  • resocoder (Followed his style in Clean architecture)
  • felangel (For his amazing state management solution)
  • Axel Fuhrmann (For the Rick and Morty GraphQL API)
  • Authors of all the packages I have used, who made our lives easier.

Getting Started

For help getting started with Flutter, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Comments
  • Updated dependencies to work on flutter 2.2.0

    Updated dependencies to work on flutter 2.2.0

    Hey!

    I noticed the app was not working on the newest version of flutter. Here are the changes I made:

    • I updated most of the dependencies to the latest version, and did the necessary changes for depreciated usages.

    • I changed the mock package from Mockito to Mocktail (https://pub.dev/packages/mocktail)

    • I upgrade the gradle version

    • I set the IOS platform to 9 for sqflite to work

    Please let me know if there's something you need me to change 💙

    opened by aumb 5
  • Upgraded to null safety

    Upgraded to null safety

    I upgraded most packages to their null safety versions:

    • data_connection_checker is discontinued (no null safety version) so i replaced the package with internet_connection_checker (https://pub.dev/packages/internet_connection_checker) which is basically the same package but with null safety.

    • Some tests where failing because null safety requires mocking Future<void> functions so i added them

    opened by aumb 2
  • Question about the entity model

    Question about the entity model

    In the api documentation, the character schema has a list of the episode schema.

    If I want to make a query like this:

    query($page: Int!) {
      characters(page: $page) {
        results {
          id,
          name,
          status,
          species,
          image,
          type,
          episode {
            name,
            air_date,
            episode
            
          }
        }
      }
    }
    

    Can I insert the List field in the character entity, for example?

    opened by smiqueias 1
  • project build/run instructions

    project build/run instructions

    hi, thanks for this great example/template project. unf. ive had no luck in being able to get it to build/run. would you be able to add instructions for this ?

    opened by SogoGolf 1
  • unable to run example with latest version of graphql-flutter

    unable to run example with latest version of graphql-flutter

    I tried to run the app with the new version 1.5 of Flutter and also the latest version of graphql-flutter: ^1.0.0+4

    and ran into issues.

    The main issue is the fact the Client is not used in the new graphql-flutter version. and refactor to

    static final HttpLink httpLink = HttpLink(
        uri: 'https://rickandmortyapi.com/graphql',
      );
    

    is not working.

    Are you able to update the example with Flutter 1.5

    BTW: using the graphql-flutter version 0.9.5 in combination with Flutter 1.5 gives all kind of errors in the console

    thx, and already thx for the great example.

    opened by HBO2 1
  • ♻️ Refactored

    ♻️ Refactored

    • Use functional_enum for types which can be replaced by enums. this decreases the amount of code by a lot btw
    • Use JsonConverter for converting types instead of using static methods
    • Remove deprecated abstract keyword for freezed classes
    opened by elias8 0
  • Remove interface INetworkInfo and Change tests accordingly

    Remove interface INetworkInfo and Change tests accordingly

    Refactor NetworkInfo

    Removed Abstract class INetworkInfo from network_info.dart and made suitable changes in home_repository.dart and home_repository_test.dart.

    Fixes #14

    hacktoberfest-accepted 
    opened by agent515 0
  • How to use this GraphQL implementation for Authenticated link. when auth token is generated in real time.

    How to use this GraphQL implementation for Authenticated link. when auth token is generated in real time.

    I was trying your graphql implementation on an app which has authentication (login/signup) now after the login we get the token, how to update the graphql link with the new auth link.

    opened by bhartendu27 1
  • What about example with mutations?

    What about example with mutations?

    Is your feature request related to a problem? Please describe. A read-only example is just a tiny tip of the iceberg. When we start to modify data there are a lot of new problems appear.

    opened by denis-isaev 0
Owner
Venkatesh Prasad
Flutter Developer
Venkatesh Prasad
Shortcuts and actions - Spice up your Flutter Desktop/Web apps with Shortcuts and Actions

Spice up your Flutter Desktop/Web apps with Shortcuts and Actions A desktop/web

Waleed Arshad 12 Nov 20, 2022
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

Sandip Pramanik 4 Aug 4, 2022
A demo Project Showcasing HowTo use GraphQL to conect as a client to a GraphQL service.

graphql_demoapp A Flutter App to demonstrate how to work with GraphQL Server, connecting through our app as a client. Working with basic queries and m

Igor L Sambo 2 Nov 7, 2021
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package. Built after react apollo

Flutter GraphQL Table of Contents Flutter GraphQL Table of Contents About this project Installation Usage GraphQL Provider [Graphql Link and Headers]

Snowball Digital 45 Nov 9, 2022
A GraphQL client for Flutter, bringing all the features from a modern GraphQL client to one easy to use package.

GraphQL Flutter ?? Bulletin See the v3 -> v4 Migration Guide if you're still on v3. Maintenance status: Low. Follow #762 for updates on the planned ar

Zino & Co. 3.1k Jan 5, 2023
Lite-graphql - A light way implementation of GraphQL client in dart language

lite GraphQL client A light way implementation of GraphQL client in dart languag

Vincenzo Palazzo 3 Mar 17, 2022
Random Users app, developed with Flutter and using Clean Architecture, BLoC, TDD and Functional Programming.

random_users This project is a sample of how to build a Flutter application using de benefits of Clean Architecture, TDD and Functional Programming. G

Yago Nunes 3 Jul 21, 2022
Flutter - Clean Architecture & TDD

Flutter - Clean Architecture & TDD Introducción Este proyecto consta de una aplicación móvil desarrollada en Flutter, la cual muestra información acer

Jorge Fernández 21 Oct 26, 2022
Flutterstarterproject - Clean Architecture Flutter starter project, using tdd + bloc

Flutter Starter Project Generated by the Nero Lab CLI ?? A Nero Lab Project crea

Muhammad Noerhidayatullah 12 Dec 8, 2022
Clean Architecture Project with TDD Approach

Clean-Architecture-Project-with-TDD-Approach Small project to implement TDD(Testing Driven Development) by applying SOLID and YAGNI and rules(Clean Ar

null 7 Jun 24, 2022
Flutter, Dart, TDD, Clean Architecture, SOLID e GetX

cep_search_clean_architecture A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to ge

Jadiel Santana 3 Feb 22, 2022
Clean Architecture + TDD + SOLID + Dependency Injection + GitFlow + Mobx

Clean Architecture + TDD + SOLID + Dependency Injection + GitFlow + Mobx Flutter Interview Challenge This app is part of an interview process. It took

Vinicius Souza 13 Dec 28, 2022
Flutter auth app with TDD Clean Architecture

Flutter App Auth ?? This is App with Auth Function like Login and Register. All API using reqres.in. This app also implementing Flutter Clean Architec

LazyCat Labs 73 Dec 29, 2022
Github-apps-flutter - Github Apps Build Using bloc 8.0 and Github API

Github_apps Inspiration This app is made to build using bloc 8.0 and github API.

Irvan Lutfi Gunawan 18 Apr 14, 2022
Ouday 25 Dec 15, 2022
Example of Continuous Delivery with Flutter, Firebase App Distribution, and Github Actions

Example of Continuous Delivery with Flutter, Firebase App Distribution, and Github Actions

Anycloud 2 Apr 5, 2022
Flutter boilerplate with TDD architecture

flutter_tdd_architecture A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you

Dao Hong Vinh 6 May 25, 2022
clean architecture and clean code with flutter , with bloc and getx state managment .

example_bloc A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if

Khaled ElTohamy 6 Aug 22, 2022
Flutter Architecture inspired by Domain Driven Design, Onion and Clean Architecture

Inspiring Domain Driven Design Flutter Architecture Please take a look at my slides to learn more Strategic Domain Driven Design For Improving Flutter

Majid Hajian 324 Dec 25, 2022