core/platform_capability_registry
library
Classes
-
PlatformCapabilityRegistry
-
SSOT for PlatformCapabilitySnapshot — computed (or injected) exactly
once at construction and cached for the lifetime of the instance, so
every read is free and no code path re-queries platform state.
-
PlatformCapabilitySnapshot
-
Immutable, already-resolved capability snapshot for the 4 domains this
kit actually integrates with: haptics (
haptics.dart), shaders
(AuroraBgLayer/NeonAuraLayer), local notifications
(ReminderService), and background audio (AudioManager).
Enums
-
PlatformKind
-
This kit's classification of the running platform — coarser than
TargetPlatform (folds "on the web" in as its own kind regardless of
the underlying OS, since web capability differs from native regardless
of
TargetPlatform).
Functions
-
detectPlatformCapabilities({bool? isWeb, TargetPlatform? targetPlatform})
→ PlatformCapabilitySnapshot
-
Pure detection — no platform channel, no plugin, just the 2 primitives
Flutter itself already resolves at process start
(
kIsWeb/defaultTargetPlatform). isWeb/targetPlatform are
injectable so a device-matrix test can fixture every combination
without needing a real device per platform. Never throws.