Skip to content

Flutter Issues and Missing Features

Matt Carroll edited this page Oct 23, 2023 · 2 revisions

One of the goals of this Swift UI clone is to prove that Flutter can do anything that Swift UI can do. There shouldn't be any UX that can be produced by Swift UI but not by Flutter. Also, delivering those user experiences should require a similar level of complexity, regardless of toolkit.

In the case that this effort does discover Swift UI capabilities that Flutter doesn't offer, this document describes those issues and missing features.

Access image assets by name

Swift UI lets developers use image assets by name: Image("logo")

This differs from Flutter's file path requirement: Image.asset("assets/images/logo.png")

To implement the Swift UI version, we can probably parse the asset manifest ourselves. However, this is an undocumented use of the asset manifest, and the asset manifest doesn't otherwise seem intended for use outside the framework. This approach could break at any time, if Flutter changes the structure of the asset manifest file, or removes the asset manifest file in preferences of some other approach.

Flutter should provide a stable API for querying available assets.

Flutter issue: https://github.com/flutter/flutter/issues/137043

Localizing strings

Swift UI localizes values at runtime. For example, using "pencil" as the label for an Image, and an app running in a Spanish locale, the image will be given an accessibility label of "lápiz".

This feature conflicts with Flutter's current way of handling localization, which expects developers to request compile-time values, e.g., MaterialLocalizations.of(context).pencil.

As a temporary solution, we might be able to read the .arb file and index it ourselves.

There's a Flutter issue to provide key'ed localization at runtime: https://github.com/flutter/flutter/issues/105672

Flutter issue: https://github.com/flutter/flutter/issues/105672