Building GitHub Flutter App — Part 1: Trending Repositories List

Home Widget

Introduction

  • Home Widget is stateful widget that provides the ListView for the repositories
  • GithubItem Widget is stateless widget that provides the list view item that represents a repo.
  • API Class is a Dart object used as a networking layer for requesting repositories using the GitHub API
  • Repo Class is a Dart object used as a model object for a repo.

Home Widget

  • _repos: Array of Repo object that represents the repositories from the GitHub API
  • _isFetching: boolean value that represents the loading state for the request from GitHub API. We will return an Icon Widget for the view when _isFetching is true
  • error: String value that represents the state for error when fetching the request for the GitHub API. We will return an Text Widget containing the error message if error message exists.

GithubItem Widget

API Class

Repo Class

Congrats!

--

--

--

Mobile Developer and Lifelong Learner. Currently building super app @ Go-Jek. Xcoding with Alfian at https://alfianlosari.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Dijkstra Algorithm

Backup Your Dotfiles To GitHub

Using Database in an Android App.

What Hybrid App Development Framework Should You Use for Your Projects in 2020? Top 3

What Hybrid App Development Framework Should You Use for Your Projects in 2020?

Get rid of Fragment/Activity boilerplate code using Kotlin

https://unsplash.com/@randomlies?utm_medium=referral&utm_campaign=photographer-credit&utm_content=creditBadge

The Ultimate Guide To Choosing And Setting Up Your Mobile App Development Company — How Can You…

Git Cheat Sheet

SQL Server for SharePoint

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alfian Losari

Alfian Losari

Mobile Developer and Lifelong Learner. Currently building super app @ Go-Jek. Xcoding with Alfian at https://alfianlosari.com

More from Medium

Building Android Widgets In Flutter: Remember these Simple Points

The easiest way to build flavors in Flutter (Android & iOS)

Flutter Stack Weekly — Issue #1

Flutter + Firebase setup on Android & IOS