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.
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.dartruns it overPortalThemeCatalog; 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 thetest/kit_export_test.dartfiles in ui_core and each app (scripts/export-kit-data.shruns them); deliberately not part of theportal_ui_core.dartbarrel. - portal_ui_core