Skip to Content
gentlemans-stack

Adding a mobile app

How to generate a Flutter app, how design tokens reach it and the web, and how to rename it.

Generate the app with the Nx plugin. The targets it gets are in flutter-targets.md. It needs the Flutter SDK, and --skipFlutter writes files only.

pnpm nx g @gentlemans-stack/nx-plugin:mobile-app <name> [--platforms=ios,android,web,macos] [--syncApi] [--codegen]

What you get

The generator creates apps/<name> as a Flutter project wrapped by project.json, so tasks run as pnpm nx run <name>:analyze|test|format|run. The app has a theme generated from ui-libs/design-tokens and a Design tokens screen. It is wired through a go_router router (lib/core/router) and package:logging (lib/core/logging).

apps/todo-mobile is the worked example. It is a shell with no API calls yet. Add screens with the add-flutter-page skill, and run the flutter-quality-gate skill before you finish.

Design tokens

tokens.json generates the web CSS, the Flutter themes and the email constants, and generate-check fails when one is stale

Edit ui-libs/design-tokens/src/tokens.json, then run pnpm nx run design-tokens:generate. It rewrites these outputs.

  • app_tokens.g.dart and the bundled fonts in every Flutter app.
  • The web tokens.css, with WOFF2 fonts compressed from the TTFs.
  • apps/email-templates/src/email-tokens.g.ts, which holds literal colors because mail clients ignore CSS variables.
  • design-tokens.md.

design-tokens:generate-check catches drift. Never hand-edit a generated file.

Status colors (danger, info, success and warning, each in base, on, container and onContainer) map to shadcn (bg-success, bg-destructive-container) and to Material (the error* roles, plus context.status for the rest).

Any ui-libs/* design system whose globals.css imports ./tokens.css gets its own generated copy. New design systems from deployable-web-app do. The web twin of the tokens screen is /design in apps/todo-ui.

Renaming an app

pnpm nx g @gentlemans-stack/nx-plugin:mobile-app-rename <name> [--newName] [--orgId] [--appName]

This changes the folder, Nx project, Dart package, bundle id or applicationId, and display name everywhere. Use --dry-run first. A bundle id change is a new app identity on the stores.

On this page