allflag

Favorites and Recent — v0.3.0+5

v0.8 update: core features now use FlagItem/FlagId and FlagPreferences. Country-only persistence details below describe the original release; see Generic Flag Catalog and migration for the current schema. User-facing behavior and device QA expectations remain unchanged.

The existing country selector now has optional Favorites and Recent sections, followed by All Countries. Favorites are alphabetical, unique within their section, and remain in the full catalog. Recent contains at most five unique countries, most recently selected first. Selecting a recent country moves it to the front. Favorite toggles do not select a country or change Recent.

Any non-whitespace search hides the section headings and shortcut rows and uses the existing case-insensitive partial-name/code search. Clearing search restores the sections. Stars have explicit add/remove accessibility labels, while the selected-country checkmark remains a separate indicator. Headings have header semantics. All rows remain lazily built with small decoded thumbnails.

Persistence architecture

There is no network access, authentication, analytics or cloud synchronization. Android identity, manifest and signing configuration are unchanged. No private signing material is accessed by application code.

Validation and follow-up

Unit tests exercise add/remove/deduplication, recent ordering/cap/move-to-front, stale codes, persistence across adapter instances, and malformed storage. Widget tests exercise empty/search-hidden sections, accessibility labels, recreation, rotation, selection, ordering, failed-save retry and rapid queued writes after disposal. Existing catalog/asset/search/landscape tests remain in place.

Storage tests use an in-memory implementation of the plugin API, not real device disk. Verify cold-start persistence and immediate background/close/reopen on physical Android and iOS devices. Like ordinary preference storage, this is not critical transactional storage: abrupt termination during a pending write can lose that last change. Uninstalling/clearing app data removes preferences; OS backup/restore behavior follows platform settings. There is no account sync.

Plugin reference: https://pub.dev/packages/shared_preferences

Validated release (2026-09-17)