Why Flutter needs a service like Expo

Magistro
3 min readApr 21, 2020

--

For those of you who haven’t used Expo before, here’s an extract from its documentation:

Expo is a framework and a platform for universal React applications. It is a set of tools and services built around React Native and native platforms that help you develop, build, deploy, and quickly iterate on iOS, Android, and web apps from the same JavaScript/TypeScript codebase.

Sounds great, right? Let’s take a closer look at that and find out what it actually means. Then we’ll look at whether Flutter could benefit from such a service.

Initialisation

The first step in using Expo (project initialisation) gives developers access to a variety of templates (e.g. TypeScript and React Navigation pre-installed) to start from with a single CLI command.

React Native really benefits from this because by default React doesn’t ship out of the box with many features Flutter developers take for granted, such as navigation. Also, JavaScript lacks type safety, prompting many developers to need Typescript.

Is this needed in Flutter? At first glance, it might seem like this feature is not needed for Flutter. However, this isn’t all these commands could be used for. Just think about all the time you spend configuring your Flutter project when creating one from scratch. One great example is structuring your project Dart files in a scalable way, and configuring your state management architecture (BLoC, Redux, MobX etc). An Expo-like command could allow you to type in a command like Expo init, which would then give you a variety of different templates. These could be heavily opinionated, much like a Rails app is. However, it would save developers a lot of time. It would also help beginners get to know how to write and architect maintainable, scalable apps. (This is sorely missing from the Flutter ecosystem).

Plugins

Expo also creates and maintains many plugins for React Native apps using its managed workflow. This is necessary since React Native (as does React) likes to keep its core small, and also the React team doesn’t produce many extra packages.

Flutter doesn’t suffer from these problems as much, with the Flutter team doing a great job of supporting and maintaining many plugins (e.g. camera, connectivity). However, there are some critical areas which aren’t touched by the Flutter team. One example is the Facebook login plugin, which looks like it is about to be deprecated. Either the Flutter team needs to expand and work on more plugins, or a Flutter version of Expo needs to pick up the slack. Developers would feel safer using a plugin supported and well-maintained by an organisation, rather than a single developer.

Publishing

One-command publishing is an amazing Expo tool. It allows you simply to run expo publish and your app will be immediately hosted on a CDN (though not on the Play or App Store). This can then be shared with others.

Without a doubt, this would be a really cool tool for Flutter to have.

However, an even cooler feature is the Expo build service. With this, you can let Expo handle everything from your Apple distribution certificates to provisioning profiles — something which is a real pain when dealing with iOS.

Currently, Flutter developers still have to deal with the annoyances of code signing on a platform-specific level. This all needs to be managed for iOS and Android. Therefore, when it comes to publishing apps on the app stores, the magic of cross-platform very quickly loses its lustre.

Managing code signing and other platform-specific publishing idiosyncrasies would make Flutter development truly cross-platform. Of course, developers would still need to register with both Google Play and the App Store. However, they could register their credential with the single Expo-like service. All the rest, including code signing, would be handled automatically.

Hot code push

Expo provide a service for hot code push, which allows developers to push updates to their apps without users having to install a new update.

This is pretty cool, but the Flutter team has rejected this feature suggestion. To be fair, the reasons for this are pretty valid.

This isn’t a deal-breaker.

Conclusion

There’s more I could have talked about, but these are the main areas where an Expo-like Flutter service would make Flutter a no-brainer for rapid product development.

--

--