Advanced Flutter Project - Setting Up the Basic Structure - Part One

Repository

https://github.com/flutter/flutter

What Will I Learn?

  • You will learn about BLoC structure
  • You will learn how to use Streams and Sinks
  • You will learn how Utopian Works
  • You will learn how to access APIs
  • You will learn how to join together Tabs and Stream Events
  • You will learn how to refactor a flutter project

Requirements

System Requirements:
OS Support for Flutter:
  • Windows 7 SP1 or later (64-bit)
  • macOS (64-bit)
  • Linux (64-bit)

Required Knowledge

  • A basic knowledge of localization
  • A fair understanding of Mobile development and Imperative or Object Oriented Programming
  • Basic knowledge of how to read JSON-like data or ARB data

Resources for Flutter and this Project:

Sources:

Flutter Logo (Google): https://flutter.io/

Difficulty

  • Advanced

Description

In this tutorial video, we setup the basic structure for the Utopian Rocks Mobile application so that in future videos, it will be possible to expand upon the code and add new features. The Utopian Rocks Mobile application is a prime application for a tutorial because it features many advanced concepts that can't be covered on their own. The application features two main BLoCs (Business Logic Components) and it gets its data from three separate APIs. It uses a Custom Font, has a custom launcher icon, and uses many other advanced features from the flutter platform.

Building an Application based on an Existing Application

The original Utopian Rocks application is based on an existing web application. This application was created because the Utopian front end was compromised. Contributors wanted a way to be able to see the moderation process and the voting process at a glance. The application features multiple pages which show the multi-step process that a contribution goes through when it enters the Utopian platform.

urs.png

The web application featured above shows the basic layout of the Utopian Rocks application. Contributions are laid out in a list with their title, repository and category. You can filter the contributions by category using the icons at the top as well. The "Waiting for Review" page shows all of the contributions awaiting moderation. The "Waiting for Upvote" page shows all contributions that have been moderated and are waiting for an upvote.

u-rm.png

The mobile version of this application that we are building in this series mirrors the web application in look and in functionality. Two primary tabs exist to show the user the general Utopian Pipeline in the same way that it is shown on the web application. Each contribution is also laid out in the same way that they are found on the web application. Users also have the ability to filter through each of the contributions by category just like with the web application.

Building a BLoC for the Contribution Data

To get started rebuilding this application, we need to be able to bring the in data from the Utopian Rocks API endpoints. For this purpose, we can build a Business Logic Component or BLoC. This BLoC allows us to manage the state and data of the application using streams and sinks in a very reactive manner. As the user does something with the User interface, the data will change accordingly.

BLOC.png

In this case, the user interacts with the view either by opening the application or by choosing a tab. The each tab sends a string event back to the BLoC through a pageName sink or behavior subject. The sink then enters the BLoC and it calls the API to get the data. The data is then passed back to the results stream and this stream creates the resulting view. Because pageName is a behavior subject it will only call to the API if the string event is different from the proceeding event which stops the application from calling the API when the Tab is not changed.

The Source Code for this video may be found here: https://github.com/tensor-programming/utopian-rocks-demo

Video Tutorial

Curriculum

Projects and Series

Stand Alone Projects:
Building a Calculator
Movie Searcher Application

Minesweeper Game

Weather Application

Redux Todo App

Curriculum

Proof of Work Done

https://github.com/tensor-programming

H2
H3
H4
3 columns
2 columns
1 column
7 Comments