Flutter handoff

Moonshot is built in Flutter, so the handoff is Flutter-first: one generated Dart file for the tokens, and widget code on every component page. These are the exact values and the widgets we recommend; building them stays with the Moonshot team.

Tokens
29 colours × 4 modes
Text styles
12 in Allo
Components
19, each with widget code
Synced from Figma
2026-11-24
1

Add the fonts and icons

Allo is free under the SIL Open Font License. Put its Medium, SemiBold and Bold cuts in assets/fonts; the static files mean FontWeight picks the cut, with no FontVariation to set. The icons are Moonshot's own set: copy flutter/assets/icons and moonshot_icons.dart, then use MoonshotIcon(MoonshotIcons.close).
pubspec.yaml
dependencies:
  flutter_svg: ^2.0.0   # draws the kit's own icons

flutter:
  assets:
    - assets/icons/   # the 24 SVG files from flutter/assets/icons
  fonts:
    - family: Allo
      fonts:
        - asset: assets/fonts/Allo-Medium.otf
          weight: 500
        - asset: assets/fonts/Allo-SemiBold.otf
          weight: 600
        - asset: assets/fonts/Allo-Bold.otf
          weight: 700
2

Copy the tokens

moonshot_tokens.dart is generated from the Figma variables with pnpm tokens. Copy it into the app as it is and never edit it by hand: the next sync would undo the change.
Files
lib/
  theme/
    moonshot_tokens.dart     ← flutter/lib/moonshot_tokens.dart from the kit
  main.dart
3

Register the colour modes

The four Figma modes are four constant instances of one ThemeExtension. Dark is the default.
lib/main.dart
import 'theme/moonshot_tokens.dart';

ThemeData moonshotTheme(MoonshotColors c) => ThemeData(
  brightness: c == MoonshotColors.light ? Brightness.light : Brightness.dark,
  scaffoldBackgroundColor: c.bgGround,
  fontFamily: MoonshotType.family,
  extensions: [c],
);

MaterialApp(
  theme: moonshotTheme(MoonshotColors.light),
  darkTheme: moonshotTheme(MoonshotColors.dark),   // or MoonshotColors.fakeGlass
  themeMode: ThemeMode.dark,
);

// In any widget:
final c = Theme.of(context).extension<MoonshotColors>()!;
Container(color: c.bgSurface, padding: const EdgeInsets.all(MoonshotInset.card));
4

Use the names

Widgets read roles, never raw values. The names match Figma, so a variable in the design is the same word in the code.
MoonshotColors
Every colour role, one instance per modec.accentFill, c.textSecondary
MoonshotSpace
The 8 spacing options, 2 to 32MoonshotSpace.s16
MoonshotGap, MoonshotInset
Gaps between children, padding inside componentsMoonshotInset.card
MoonshotSize, MoonshotRadius, MoonshotLayout
Heights and hit areas, corners, screen layoutMoonshotSize.buttonL, MoonshotRadius.popup
MoonshotType
The 12 role text styles in Allo, with real line heights and trackingMoonshotType.amountXl
MoonshotScale
The general type scale, 26 steps from 10 to 64 in three weightsMoonshotScale.semiboldH4
MoonshotMotion, MoonshotBlur
The ease-out curve, durations, blur sigmasMoonshotMotion.press

Component to widget

The widget to start from for each component. Its page has the full code.

FilledButton with a StadiumBorder, minimumSize 64 or 48, AnimatedScale for the press
IconButton.filledTonal, 52 square, CircleBorder
CupertinoSlidingSegmentedControl, or a Stack and AnimatedAlign for the exact pill
A Column of Text with tabular figures, the swap pill, a Row of chips, a GridView keypad with InkResponse
GestureDetector and a CustomPainter ruler, wrapped in Semantics(slider: true)
GestureDetector drag plus a long press driving a 900ms AnimationController
A DecoratedBox card, a Column of detail rows, a Divider
MenuAnchor in a GlassPanel, which is a BackdropFilter, with MenuItemButton items
showModalBottomSheet with a transparent background, Padding(8) then ClipRRect(44)
A push notification; the in-app banner is a GlassPanel
A Positioned GlassPanel capsule with 52pt tab targets
A DecoratedBox card with a LinearProgressIndicator and detail rows

Rules that matter in Flutter

  • 1Glass is a BackdropFilter, a translucent fill and a 1px edge. Clip it with ClipRRect or it blurs the whole screen. Never stack two.
  • 2Blur sigma is the Figma blur radius ÷ 2. The values are in MoonshotBlur.
  • 3Money uses tabular figures: fontFeatures: [FontFeature.tabularFigures()]. Allo has them.
  • 4Haptics fire with HapticFeedback on the same frame as the change, never after an await.
  • 5Targets are 44pt or more. Wrap small visuals in a SizedBox hit area.
  • 6Show the 2px focus ring only in FocusHighlightMode.traditional: keyboard and switch control.