Code Monkey home page Code Monkey logo

flutter-news's Introduction

Contributors Forks Stargazers Issues


Logo

Flutter News

A Flutter project detailing how to build an application using TDD and clean architecture.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started

About The Project

Before We Start

This application uses BLoC. Providing you are using Clean Architecture in the intended manner, it ultimately doesn't matter what state management solution/framework you choose as you can easily swap one out for the other as you'll find below.

If you want to view a similar project that uses Riverpod, please click here

There are a number of Flutter tutorials out there that illustrate how to build an application with different state management solutions such as BLoC, GetX, Riverpod etc. However most are incomplete, they do not show how to integrate networking and make API calls or how tests can be written. In short, they do not provide an overall solution for clean architecture implementation. This project aims to give an insight into how you would create a production-level application that is scalable, testable and written with clean code.

Here's what you can expect to learn from this project:

  • How to structure your application so that everything is modularised and discrete.
  • How to write tests for every module of your application.
  • How to structure your architecture in such a way that you can replace modules with different tools/libraries as you see fit. E.g. Replacing your BLoC state management with something like Riverpod.

There are certainly a number of ways that you can implementation your application such that you abide by the right design principles (SOLID, DRY, YAGNI etc.). However, there is no one approach that works better than the others. There is only those that are more modularised. Hence, the approach you should take depends on the project, its requirements and its constraints. For example, if you needed to create an MVP in a short amount of time you certainly wouldn't want to implement an architecture that conformed to TDD and was made of discrete components. You would want to use something that required little boiler-plate code and that should be developed quickly.

With that said, this approach here is not meant for MVP applications but rather for large-scale applications that require unit testing and components that aren't coupled together. I discuss in detail what the approach entails and how and why modules are organised and created in the fashion they are. You can read about it at the README here.

Built With

Getting Started

To get a local copy up and running follow these simple example steps.

Prerequisites

  1. Follow the Flutter guide on Get Started to install the Flutter SDK on your machine. NOTE this project is built with Flutter version 2.8.0.
  2. Ensure everything is installed correctly by running the command flutter doctor --verbose on your terminal.

Installation

  1. Get a free API Key at News API.
  2. Clone the repo
    git clone https://github.com/ajvelo/Flutter-News.git
  3. Install pub packages
    flutter pub get
  4. Create a file in lib/core/ called constants.dart
    class Constants {
      static const apiKey = "YOUR-API-KEY";
    }

Roadmap

See the open issues for a full list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

flutter-news's People

Contributors

ajvelo avatar

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.