My first Flutter App

Using Firebase ML, TensorFlow, and Flutter I have put together a new image recognition app.

I began with teaching the ML Kit the difference between Chickens and Squirrels, it turned out to be very simple, just as my previous version using React and Clarifai had been, however at the moment AutoML is very new and doesn’t yet have Flutter extensions ( could change any day now ), so I changed tack and tried out one of their standard libraries instead.

Firebase ML will create an on-device API for you, it was a surprise to me, you just grab a package from your Firebase project and just import that into your App.

This is a big improvement on the clarifai app in that being local it happily works offline, there’s no usage cap to worry about, just install it on your phone and it will work anywhere anytime.

The initial Squirrel Chicken testing.

And a screenshot from the App. Pretty tricky for the AI this one, the generalised version can’t tell that it’s a Red Panda, I can forgive that, many people wouldn’t know. But I think it’s hedging its bets a bit by saying 82% dog and 64% cat – obviously can’t be both, probably it’s saying it has 82% dog characteristics and 64% cat characteristics. Think I would discard any results with less than 90% certainty but I need to test that.

Why I’m playing with Dart Again

tl;dr Because of Flutter

Back in 2013, I thought Dart would get traction on the web, Google had added a VM to chrome and I was looking to make the move from Flex and ActionScript 3, I experimented and created a couple of small projects, the first was a ball bouncing demo and the second was a simple Slot reels demo.

I preferred type-checked OOP and at the time JavaScript seemed like a step backwards. ( We were still several years away from Babel and even further from TypeScript, neither were on the radar at that time), Dart seemed like an exciting new option for me.

The flaw in Google’s plan and subsequently mine was that Chrome only had about 30% browser share and it soon became apparent that the other browser vendors had no intention of integrating the Dart VM into their products and that was enough to kill it, sometime later Google dropped the VM and it seemed Dart was dead.

Skip forward to 2019 and I’m fully in on React and TypeScript, although I now develop in a more functional way, I have a component architecture again and TypeScript and Babel have given me a great programming language.

In the meantime I had developed a couple of Apps using React Native but the developer experience wasn’t great, I’m used to hot-reloading and React Native and Expo felt slow and clunky (This was back in late 2017, since then there’s been several improvements including Fast Refresh – so I will take a fresh look soon ), and there were stories of development teams who had tried and abandoned their efforts and returned to native languages.

Then in December 2019 at the Flutter Interact conference, the 1.12 release was announced.

Flutter uses Dart as its language and has a component architecture.

In many ways, Flutter feels like Apache Flex circa 2005 but this time you don’t need a plugin! Turns out I’m not alone and was very happy to see one of my old flash heroes Grant Skinner take the stage and present some great UX work.

It even has tools which remind me of Flash for example Rive.

Not only can you write once for Android and iOS but now there is beta support for web and alpha support for mac, with the ambition of deployment to any OS! including Fuschia OS.

The write once run anywhere idea is not new, but the idea of compiling everything to native and not using some sort of bridge/wrapper/plugin is ( ignoring game engines such as Unity – license fees might be payable ).

Google is calling this Ambient Computing and if it works then the future may mean that it doesn’t really matter what OS you use, you can use any Flutter app.

I’ve just started my first project, to rebuild Bug Bounce, it’s probably not the best way to make a game ( I’d choose Unity for a serious project ), but it is a great way to learn a new language and framework, data, graphics, UI etc.


JavaScript or EcmaScript

I’ve just started looking for a new Job and after a few calls from the Agencies, there’s one question which I’m finding hard to answer.

How many years of JavaScript experience do you have?

I think the question should really be.

How long have you been using EcmaScript and which versions?

So whilst I have been using JavaScript for 17 years and I could just say that it’s changed a lot in that time and then for much of that time it wasn’t something I was using full time.

For years I was using Actionscript 3, you might know that it’s an ES4 language, which counter-intuitively has much more in common with ES6 aka ES2015 aka Harmony, Typescript and Google Dart than it does with ES5!

But how could ES4 have those features if they weren’t in ES5? Well ES4 was ambitious it added Classes and more to JavaScript and it got bogged down politically. In 2007 it was abandoned and the standards committee went for a less radical update, however, Adobe had the freedom to add whatever they liked to their own VM in the Flash Player and they went ahead, it’s only relatively recently that it’s features are appearing in the browsers thanks to ES6 and Babel.

And then just to confuse the agencies, even more, there’s TypeScript, which some refer to as ES2016+ or ES+! But try explaining that to a recruiter and most would just glaze over.

This article explains what happened to ES4.
EcmaScript 4 was too far ahead of its time

Brendan Eich’s feelings about the abandonment of ES4, worth reading the comments if you’re curious about why it happened, but a lot of suspicion around it being a political move by Microsoft to hold the web back.
https://brendaneich.com/2007/11/es4-news-and-opinion/

This shows where ES4 fits in.
https://en.wikipedia.org/wiki/ECMAScript

And if you’ve never seen AS3 then here’s a link so you can see how similar it is to ES6.
https://en.wikipedia.org/wiki/ActionScript#ActionScript_3.0

John Papa’s thoughts on whether Typescript should be referred to as  ES+
https://johnpapa.net/es5-es2015-typescript/