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: 7002
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.dart3
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 mode
c.accentFill, c.textSecondaryMoonshotSpace
The 8 spacing options, 2 to 32
MoonshotSpace.s16MoonshotGap, MoonshotInset
Gaps between children, padding inside components
MoonshotInset.cardMoonshotSize, MoonshotRadius, MoonshotLayout
Heights and hit areas, corners, screen layout
MoonshotSize.buttonL, MoonshotRadius.popupMoonshotType
The 12 role text styles in Allo, with real line heights and tracking
MoonshotType.amountXlMoonshotScale
The general type scale, 26 steps from 10 to 64 in three weights
MoonshotScale.semiboldH4MoonshotMotion, MoonshotBlur
The ease-out curve, durations, blur sigmas
MoonshotMotion.pressComponent 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 pressIconButton.filledTonal, 52 square, CircleBorderCupertinoSlidingSegmentedControl, or a Stack and AnimatedAlign for the exact pillA
Column of Text with tabular figures, the swap pill, a Row of chips, a GridView keypad with InkResponseGestureDetector and a CustomPainter ruler, wrapped in Semantics(slider: true)GestureDetector drag plus a long press driving a 900ms AnimationControllerA
DecoratedBox card, a Column of detail rows, a DividerMenuAnchor in a GlassPanel, which is a BackdropFilter, with MenuItemButton itemsshowModalBottomSheet with a transparent background, Padding(8) then ClipRRect(44)A push notification; the in-app banner is a
GlassPanelA
Positioned GlassPanel capsule with 52pt tab targetsA
DecoratedBox card with a LinearProgressIndicator and detail rowsRules that matter in Flutter
- 1Glass is a
BackdropFilter, a translucent fill and a 1px edge. Clip it withClipRRector 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
HapticFeedbackon the same frame as the change, never after anawait. - 5Targets are 44pt or more. Wrap small visuals in a
SizedBoxhit area. - 6Show the 2px focus ring only in
FocusHighlightMode.traditional: keyboard and switch control.