Advanced Flutter Project - Filtering Contributions and Building Aesthetics - Part Five

in #utopian-io6 years ago

Repository

https://github.com/flutter/flutter

What Will I Learn?

  • You will learn how to add a custom Icon to a Flutter App
  • You will learn how to space out a horizontal application bar
  • You will learn about local image assets
  • You will learn how to filter through various stream events
  • You will learn how to combine streams to make new streams
  • You will learn about the PopupMenuItem and the PopupMenuButton Widgets

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 Programming
  • A fair understanding of Mobile development and Imperative or Object Oriented Programming
  • Basic knowledge of the BLoC

Resources for Flutter and this Project:

Sources:

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

Difficulty

  • Advanced

Description

In this video, we expand the Aesthetics of the application by adding the color theme, some images and a icon for the application launcher. We also expand the contribution BLoC so that the user can filter the contributions by category. This includes making a popup menu which the user can select the filters from and merging streams to build a new filtered results stream.

Overriding the Default Flutter Icon and Adding Local Images

There are various ways to override and implement a application launcher icon in flutter. The method of choice for this video is a library called flutter_launcher_icons. This library allows the developer to define various keys in the pubspec.yaml file or a separate .yaml file which define how the icon should look. This includes the ability to have multiple icons based on the platform and create dynamic backgrounds to fill in the gaps of the icon based on the size.


top-icon.png

In the image above, you can see the application icon for this particular application. The icon uses an image that exists on the utopian.rocks website as a sort of branding. In this image, it just floats on top of the top application bar but in the application menu, the icon is surrounded by a white square background. This same image is used on the finished application bar for when the application is actually open.

Filtering Events and Combining Streams

Other than the Aesthetic tweaks that we made in this tutorial, we implement a filter system which allows the user of the application to filter the contributions by category. This system is important because it makes it easier to parse the data in the list view and find a specific contribution. There is already a stream in the contribution bloc which creates the general list view and so it is just a matter of augmenting that stream with the user events from interacting with a popup menu. This is achieved by Combining the two streams with a function.


stream-merge.png

The original results stream is paired with the user input streamsink and then pushed through a function called applyFilter. Because the PopupMenu widget returns strings which correspond with the various contribution categories, we can easily combine the two stream's events together to create a new stream called filteredResults. This new stream returns the filtered events according to the function's logic and we are able to replace the list view's stream with this new stream. With this change, are list view can now react to the user input on the PopupMenu.

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

Video Tutorial

Curriculum

Related Videos

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

Sort:  

Hi @tensor

It is a lot of fun for me to watch how you put in the aesthetic look into the mobile app. This is incredibly informative and educational.

I thoroughly enjoyed watching the whole process of how the colors and pictures are put in.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you @rosatravels, always nice to hear your compliments. And as always, thank you for moderating my contribution.

Thank you for your review, @rosatravels! Keep up the good work!

Hi, @tensor!

You just got a 7.45% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Hi @tensor!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @tensor!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.028
BTC 64911.06
ETH 3194.94
USDT 1.00
SBD 2.60