Developer notes · Flutter · Android

Taking an edited web routine into a Flutter app

By FirstSprout ·

You can edit and run a three-minute routine in the Wend website. The tricky part is taking those exact edits into the Android app when the phone still needs to install it.

Make the edited routine reusable

Wend’s builder can run a timer right in the browser. When you ask it to create a routine link, it validates the routine name, step names and durations, then encrypts the data with AES-GCM using a fresh key and random initialization vector. The share service stores the encrypted bytes and returns a lookup identifier. The builder puts that identifier and the decryption key in a versioned URL fragment.

The fragment stays out of the initial HTTP request for the preview page. The preview code reads it, fetches the encrypted bytes by identifier, then decrypts and validates the data locally. The complete link grants access to the routine for up to 30 days, so share it with people you want to have a copy. URI fragment specification

Open the import screen on Android

The Android manifest restricts its verified HTTPS App Link to Wend’s import path. FirstSprout serves a Digital Asset Links file that associates the domain with the app’s package and Play signing certificate. Check verification on a Play-installed build. A debug build can have a different certificate, and a user’s link settings can affect where the URL opens. Android App Links verification

In Flutter, Wend uses the app_links plugin and disables Flutter’s default deep-link handler. The app filters incoming URIs for routine links and routes them to an import screen. That screen fetches, decrypts and validates the routine before offering Save a copy or Save and start. Saving creates a local routine that stays available after the link expires. Flutter deep linking

Keep a way back after installation

In Chrome for Android, the preview’s Open in Wend button uses an Android intent. If Chrome falls back to the browser, it returns to the same preview with the original fragment and shows copy instructions. Install from Google Play opens the store separately so the user can return to the same preview and tap Open in Wend. The Play URL carries only campaign labels. Chrome’s intent fallback documentation

If the app doesn’t open, the user can choose Copy routine link. When clipboard access fails, the preview exposes the link for manual copy. In Wend, the user chooses Import a routine link, Paste, then Open routine. Test both the normal App Link and the paste flow with a valid link, a denied clipboard request and an expired link.

Try the handoff with a sample routine

Change a name or duration in the three-minute starter, then select Start routine to run it in your browser. After finishing, select Create routine link and Continue with this routine. On Android, open or copy the link and check that your edit appears before saving.

Try the three-minute routine