portal_ui_core

Design system for the Portal apps: tokens (spacing, radii, type, motion, elevation, layout), a PortalUiTheme ThemeExtension, theme factories and a set of themed components.

Buttons, stat cards and cards, light theme Same page, dark theme Filter chips, segmented tabs, search, skeleton and empty state Same, dark theme

Every screenshot is the example/ app — run it on a device to walk the components with a brightness and preset toggle in the app bar.

import 'package:portal_ui_core/portal_ui_core.dart';

MaterialApp(
  theme: buildPortalTheme(brightness: Brightness.light),
  darkTheme: buildPortalTheme(brightness: Brightness.dark),
);

// in a widget
final tokens = PortalUiTheme.of(context).tokens;
Padding(padding: EdgeInsets.all(tokens.spacing.md), child: PortalCard(...));

Components: PortalAppBar, PortalBottomNavBar, PortalButton, PortalCard, PortalConfirmDialog, PortalEmptyState, PortalFilterChip, PortalSkeleton / PortalListSkeleton, PortalScrollPage, PortalSearchField, PortalSectionHeader, PortalSegmentedTabs, PortalStatCard, PortalStartupGate / PortalStartupSplash.

Three tiers of theme entry, take the highest that fits: PortalThemeConfig → buildPortalTheme → hand-rolled PortalUiTheme.

Libraries

contrast_gate
The contrast floors the kit holds, as a function every app's test can call with its own themes (F6). ui_core's contrast_gate_test.dart runs it over PortalThemeCatalog; each app runs it over the scheme it hand-writes, so a hand-tuned value cannot drift under the floor again.
kit_export
Serialises the kit's theme values to JSON for the UI kit preview (docs/ui-kit/data/), so the preview reads what the Flutter code builds instead of hand-copied hex. Imported only by the test/kit_export_test.dart files in ui_core and each app (scripts/export-kit-data.sh runs them); deliberately not part of the portal_ui_core.dart barrel.
portal_ui_core