Skip to content

GDG Milton Keynes: "What I Learned from Building a Flutter App for Cat-Sitters"

Published on · Updated on · 9 min read
GDG logo

Share

Logistics

Event

The Google Developer Group Milton Keynes regularly hosted community events. I spoke at the “Working in tech in MK: Tips and Tricks!” event in Milton Keynes on March 30, 2022, at 6 pm.

Talk

My talk was one of three that evening.

Abstract

Cat-sitters in the UK were less familiar with smartphones than average users. An app for their job was just a tool that needed to work and then get out of the way. And in their work, they often had no or just a shaky network connection.

My challenge was to build iOS and Android apps for these users while simultaneously working on the Angular web app for managers and the Java back-end. I was the lone developer in the SaaS start-up “Your Home In Good Hands”. How could I succeed?!

That’s where Flutter and Firebase came to the rescue: Flutter allowed me to build mobile apps efficiently. And services like Firebase Authentication, Firebase Storage and Google Maps did much of the heavy lifting. I discussed the advantages of Flutter and Firebase and how I dealt with Flutter challenges.

My talk also detailed how I made the mobile apps easy to use and how they worked offline. Finally, I discussed how the mobile and web apps shared a design language while respecting their platforms.

Historical note (as of March 2022): After the talk, attendees could rate it live via Mentimeter. That poll is no longer reachable today.

Slides & Video

The slides were available as a PDF (8 MB); the PDF version is available for download here.

Download slides (PDF)

Historical note (as of March 2022): Back then, the slides were also available in their original Keynote format (8.4 MB) — with less text, but animated and with a look behind the curtain of individual effects, including speaker notes; that file is no longer available today.

Get Started With Flutter

Here’s my page for getting started with Flutter.

Get started with Flutter

Additional Talk Information

What Was Flutter?

Cross-Platform: Web Framework Popularity

I said that React, Angular & Vue were the three most popular web frameworks. I knew because for my monthly Java report, I measured the popularity of JVM languages, databases, back-end frameworks, and front-end frameworks. I measured popularity among employers through job ads from 63 countries. For developer popularity, I used online training students, Stack Overflow questions, and Google searches. Here are two of the four measurements from my March 2022 report.

The Indeed job search was active in 63 countries representing 92% of the worldwide GDP in 2020. It demonstrated the willingness of organizations to pay for a technology — the strongest indicator of popularity in my mind. Angular was the baseline. Measurements were from August 2021 through February 2022.

React won, Angular was second, Vue third. After an Angular surge the previous September, React was pulling away from Angular again. Vue was slowly gaining on Angular and had nearly reached half of Angular’s mentions. JSF was an order of magnitude behind Vue.

Udemy was one of the biggest online learning sites. They published the number of courses and the number of students beyond a certain threshold. This showed how many developers evaluated a technology. Angular was the baseline. The other frameworks didn’t cross the reporting threshold for Students at Udemy (maybe around 100,000 students). Measurements were from March 2021 through February 2022.

React won, Angular’s second, Vue is third. React was steadily increasing its lead over Angular. Vue was stuck at 40% of Angular’s students.

Here are the links that showed the courses for all and the number of students for some:

Cross-Platform: Non-Web Framework Popularity

I said that Flutter was most popular with developers, but only second place with employers. I knew that from the same four measurements in my monthly Java report as above. Here are two of the four measurements from my March 2022 report.

Flutter was the baseline. Measurements were from August 2021 through February 2022.

React Native won, Flutter was second, Xamarin third, and JavaFX last. Flutter had closed nearly a third of the gap to React Native, which had nearly twice as many mentions as Flutter. Both Xamarin and JavaFX declined both absolutely and relatively — JavaFX dramatically so.

This time, React Native was the baseline. Measurements were from March 2021 through February 2022.

Flutter won, React Native was second, Xamarin third, and JavaFX fourth. Flutter had increased its lead over React Native while Xamarin had lost ground against React Native. JavaFX grew, but from a lower base level.

Here are the links that showed the courses for all and the number of students for some:

The recent Flutter 2.10 announcement said that “nearly half a million apps use Flutter” at the time.

Why Care About Native Look & Feel?

Native look & feel was important, especially on mobile, where a vocal minority would complain if an iOS app looked like an Android one and vice versa.

Google’s own apps, like Google Maps or Google Mail, had used mostly Material Design UI elements on iOS for years. Not anymore: to “really make products feel great on Apple platforms”, Google switched to native iOS UI elements.

If you didn’t use both iOS and Android regularly, you wouldn’t know that they were meaningfully different, even if you tried to make them look and feel as similar as possible!

Here were three differences:

  1. The page heading was centered on iOS and left-aligned on Android.
  2. The “Edit” button was in the navigation bar on iOS and a floating action button on Android.
  3. When you could tap on a table row on iOS, it had a chevron on the very right. Android didn’t have such an indicator.

Forms were also different:

Here were some differences:

  1. The “Cancel” button had a text label on iOS and a symbol on Android.
  2. Fields had no label on iOS, just a placeholder when they were empty. They had both a permanently visible label and a placeholder on Android.
  3. Text fields on iOS had a “Clear” button. Android didn’t have such a button.

Declarative Programming

I had a guide to getting started with declarative development:

Get started with declarative development

What Was Flutter?

Flutter didn’t use native UI elements (such as text fields or buttons). Instead, it emulated them. See here for more details.

Native UI Sample Application

I built a sample Flutter application with five different, native “look & feels” from one codebase: web, iOS, Android, Windows, and Mac. I showed screenshots during the talk. You could run it yourself if you had Flutter installed!

Check out the sample application

What I Learned About Flutter

My Project

The start-up I’d co-founded was called “Your Home in Good Hands”. As of March 2022: we were in private beta; our service was set to go public later that year.

Flutter: Mobile 👍🏻

I had a page dedicated to getting started with Flutter.

Get started with Flutter

Flutter Hot Reload made code changes go live on the device/simulator immediately. It was the main reason why working with Flutter could be such fun! Here is a video demonstrating it.

Watch the video (YouTube)

I wasn’t ready to fully share our app yet. We had screenshots on our home page, but they were slightly out of date by then.

But I did build a prototype in 2019 which at least showed a Flutter app in motion. Although it was old by then, it was still a decent example of what a native Flutter app could look like. It took me about six weeks and was my first Flutter project. I used Google’s cloud service Firebase for login, No-SQL database, and file storage. I also built my own back-end with Java, JHipster, Spring Boot, and Angular.

Watch the video (YouTube)

Firebase 👍🏻

I also had a page dedicated to getting started with Firebase.

Get started with Firebase

Mobile Power

Storing data locally and loading & saving data in the background was easy with Flutter. But we could also do that in a web application — more difficult and more restricted, but doable.

I knew because at the end of 2019, I’d built such a web application: a so-called progressive web app (PWA). A PWA used the “Service Worker” in a browser to install on your device and cache data. It took about four weeks, and it was my first PWA. I used Google Workbox for this but developed my own offline storage solution in the browser. I built my back-end with Java, JHipster, Spring Boot, and Angular.

Watch the video (YouTube)

One Source Of UI Truth

My Get Started with Flutter guide explains the use of Redux as a data store.

Here’s another example of UI inconsistencies. It came from the iPad app of the UK price comparison site Pricespy. That app wasn’t sure whether my list had seven items (top left) or just three (right).

Be Consistent

My start-up offered a web app for managers and a mobile app for cat-sitters. So arguably, consistency between them was nice-to-have.

Now most managers were also cat-sitters. So they used both apps. This made consistency a necessity!

So let’s look at the two apps. Here is the mobile app for cat-sitters:

And here is the web app for managers:

So how was this consistent — or how was it different?

  • Both apps used different navigation paradigms. The mobile app had a nav bar at the top (1) and a tab bar at the bottom (2). The web app had breadcrumbs (1) and a header (2).
  • Both apps shared the same colors. For instance, the mobile nav bar (1) & tab bar (2) and the web app breadcrumbs (1) all used the primary brand color. Navigation also used the same kind of blue (3).
  • The apps also used the same Google font for headings (4): Montserrat.
  • Finally, the apps shared symbols from Font Awesome: a walking person in this example (5).

Here are some good design books:

Back To Basics

My Get Started with Flutter guide has an architecture section that explains my proposed use of components & layers.