ecsly_flutter library

Flutter bindings for ecsly worlds, app workflows, resources, and schedules.

Classes

AppendedRows
Result of one World.appendRows bulk reservation.
Archetype
Archetype groups entities with identical component signatures. Uses columnar storage (Column abstraction) for cache-friendly iteration.
ArchetypeDebugInfo
ArchetypeMatchResult
Result of archetype matching with cached entity list.
ArchetypeRegistry
Registry for managing archetypes. Provides fast lookup by component signature.
ArchetypeSignature
Archetype signature represented as a bitmask.
BatchAddClassComponentsCommand
Command to batch add class components with data to multiple entities. Components are added with provided data and processed efficiently.
BatchAddExtensionComponentsCommand
Command to batch add extension components to multiple entities. Components are zero-initialized and added efficiently in archetype groups.
BatchDestroyEntitiesCommand
Command to destroy multiple entities in one structural batch.
BatchRemoveComponentsCommand
Command to batch remove components from multiple entities. Supports both extension and class components with optimized archetype migration.
BatchSpawnCommand
Command to spawn multiple entities with component bundles efficiently.
ColumnDebugInfo
ColumnFactory
Used to create columns for components. Example:
ColumnFactoryRegistry
Factory for creating appropriate column types based on component characteristics.
CommandExecutionFailure
CommandQueue
Component
Should be strictly serializable / deserializable data No logic.
ComponentBundle
Bundle of class based components to be added to an entity atomically.
ComponentCommands
ComponentFacadeFactory<T>
Factory for creating component facades.
ComponentFacadeRegistry
Registry for component facades. Manages facade factories and creates facades for components.
ComponentMask
ComponentMaskBase
Base class for ComponentMask implementations. Provides common logic for bitmask operations.
ComponentMaskImpl
Bitmask representing a set of component types. Native implementation using Uint64List for optimal performance.
ComponentQuery
Query builder for iterating entities with specific components and conditions. Provides cache-friendly iteration over matching archetypes with predicate filtering.
ComponentQueryBuilder
Builder for constructing queries.
ComponentRegistry
A simple, stateless registry for component types.
ConditionTrigger
Trigger based on a custom condition function.
DataColumn
Columns provide unified storage for components in a Structure-of-Arrays (SoA) layout. This abstraction enables cache-friendly memory layout and SIMD-optimized operations.
DebugPlugin
Debug plugin providing performance monitoring and metrics.
DeleteResourceCommand<T extends Resource>
DeltaTimeResource
Delta time resource for frame-rate independent movement
DestroyEntityCommand
Command to destroy an existing entity.
DeterministicSectionHashing
Shared deterministic hashing helpers for extract packets/sections.
EcsAction<TResult>
Reusable app-level workflow over an ecsly World.
EcsActionBuilder<T>
Builds UI from an EcsAction status and exposes a safe run callback.
EcsActionCancellationToken
Cooperative cancellation token passed to actions.
EcsActionContext
Context passed to reusable app actions.
EcsActionOnMount<T>
Runs an EcsAction once after this widget is mounted.
EcsActionRunner
Pure Dart runner for reusable app-level EcsAction workflows.
EcsActionServices
Minimal dependency registry for headless EcsAction tests and apps.
EcsActionStatus
Immutable status snapshot for one action key.
EcsActionStatusResource
Data-only resource containing action execution status by key.
EcsActionStatusSelector
Rebuilds from the ECS-backed status for one action key.
EcsAppScope
EcsCommand
A sealed class for all commands that can be issued to the ECS.
EcsComponentBuilder<T extends Component>
Rebuilds when component T is present on entity and the controller notifies.
EcsComponentSelector<T extends Component, R>
Rebuilds only when the selected value from component T changes.
EcsConsumer<T extends Resource>
Familiar alias for resource-backed UI.
EcsContext
Discoverable Flutter context handle for ecsly state.
EcsController
Flutter-facing notifier for an ecsly World.
EcsControllerChangeView
Read-only view of the controller's most recent notification boundary.
EcsDraft<T>
Headless edit draft with dirty, touched, and validation metadata.
EcsDraftsResource
Resource that stores active drafts by app-defined key.
EcsEvent
Base marker interface for all events.
EcsExecutionObserver
Optional, low-overhead observer for schedule/system execution.
EcsExecutionObserverBase
No-op base to simplify implementations.
EcsFieldState
Field-level edit metadata for an EcsDraft.
EcsFixedLoop
Allows to tick every attached world.
EcsFixedLoopConfig
EcsFixedStepLoop
Drives named ECS schedules with fixed-step accumulation.
EcsFixedStepMetrics
EcsFlutterLoop
Ticker-driven Flutter frame loop.
EcsFlutterSchedules
EcsFrameSchedule
EcsHostSchedule
Host-facing schedule metadata for app and Flutter integrations.
EcsInvalidationBatch
Coarse app/host invalidation hint for UI and integration layers.
EcsLoop
EcsResourceBuilder<T extends Resource>
Rebuilds when an ECS resource is present and the controller notifies.
EcsResourceSelector<T extends Resource, R>
Rebuilds only when the selected value from resource T changes.
EcsScheduleRunEvent
EcsScope
Provides an ecsly World and optional EcsController to Flutter widgets.
EcsWorldSelector<R>
Rebuilds only when a selected value from the ECS World changes.
EcsWorldSelectorDependencies
Optional dependency hint for selectors derived from multiple ECS slices.
Entities
The definitive, high-performance entity manager.
EntityCommands
Not serializable command container.
EntityIndexResource<TScope, K>
Optional data-only projection from stable app/domain ids to ECS entities.
EntityLocation
A simple struct to hold an entity's location. This is stored in the Entities manager.
EntityMigrationSystem
Handles entity migration between archetypes when components are added/removed.
EventChannel<T extends EcsEvent>
A type-safe event channel that stores events in ECS DataColumns.
EventChannelFactory
Factory for creating appropriately typed event channels.
EventChannelStats
Immutable snapshot of an EventChannel's lifecycle counters.
EventCursor<T extends EcsEvent>
Cursor for allocation-free event reads using index-based loops.
EventReader<T extends EcsEvent>
Reader interface for iterating over events in a channel.
EventRegistry
Registry for managing event channels as world resources.
EventTrigger<T extends EcsEvent>
Trigger that runs only when events exist in a channel.
EventWriter<T extends EcsEvent>
Writer interface for sending events to a channel.
EveryFrame
Trigger that runs every frame.
EveryNFrames
Trigger that runs every N frames.
EveryNSeconds
Trigger that runs every N seconds based on time accumulation.
ExcludedQuery
Query for entities that MUST NOT have any specified components.
FloatColumn
Column for storing float/double components (Position, Velocity, etc.).
IntColumn
Column for storing integer components (Health, Team, etc.).
LevelStateResource
Resource for tracking level state and transitions.
ManualTrigger
Trigger that only runs when manually invoked.
ObjectColumn<T extends Object>
Column for storing complex object components (Inventory, AI State, etc.).
ObjectColumnFactory<T extends Object>
PerformanceBudgetResource
Runtime performance budget and quality controls.
PerformanceResource
Resource tracking FPS, frame time, and entity count.
PersistentEntityMap
Plugin
A reusable feature bundle that can configure a world with resources, systems, schedules, and other plugins.
PluginRegistry
Registry for managing installed plugins.
QueryCache
Enhanced QueryCache that integrates result caching.
QueryCacheEntry
Cached query result with version tracking for structural eviction.
QueryCacheKey
Cache key for query results. Combines component mask and optional predicate for unique identification.
QueryCacheStats
QueryResultCache
Query result cache with structural component-touch eviction. Caches query results to avoid recomputation across systems.
QueryStructuralTouchTracker
Structural component-touch tracker for query-result cache entries.
RawComponentColumn<T>
RawQueryChunk2<T1, T2>
RawQueryChunk3<T1, T2, T3>
RawQueryChunk4<T1, T2, T3, T4>
RemoveComponentCommand<T extends Component>
Command to remove a component from an existing entity.
RenderProfileStatsResource
Per-frame profiling stats from the native wgpu renderer. Populated by the render bridge when profiling is enabled.
RenderSubmitMetricsResource
Render submit telemetry captured by render hosts.
RequiredQuery
Query for entities that MUST have all specified components.
Resource
Base class for all resources in the ECS world.
ResourceDebugInfo
ResourceRegistry
Schedule
A collection of systems that run together with defined ordering.
ScheduleDebugInfo
ScheduleExecutionPolicyResource
ScheduleTimeResource
Deterministic simulation time source for schedule triggers.
ScheduleTrigger
Determines when a schedule should execute.
SimdUtils
Utility functions for common SIMD operations.
SimulationControlResource
Controls simulation execution for debuggers/inspectors.
SparseColumnList
Sparse list implementation for archetype columns that provides O(1) lookup while only storing columns that exist (typically 2-10 per archetype).
SparseTypeList
Sparse list implementation for component type mapping that provides O(1) lookup while handling hash collisions with linear probing.
SpawnEntityComponentsCommand
Command to spawn a new entity with a bundle of components.
SpawnPerformanceResource
Resource tracking spawn/despawn performance metrics.
SystemDebugInfo
SystemDescriptor
Metadata describing how a system should be executed.
SystemExecutor
Executes systems with support for ordering, dependencies, async execution, and parallelization.
SystemsRegistry
Central registry for schedules, plugins, and system execution.
ThrottledTrigger
Wrapper trigger that limits execution frequency to prevent CPU overload.
TypedDataEvent
Marker interface for events that can use TypedData storage.
Uint8Column
Column for storing small integer components (0-255 range).
UpsertComponentCommand<T extends Component>
Command to add a component to an existing entity.
UpsertResourceCommand<T extends Resource>
WallClockScheduleTimeResource
Optional non-deterministic adapter used only when explicitly installed.
World
Central coordinator for the ECS world.
WorldCommands
responsible for managing world. for specific needs, use EntityCommands
WorldDebugSnapshot
WorldDebugView
A stable, read-only "debug view" over a World.
WorldDeterminismResource
Optional diagnostics for deterministic simulation/extraction verification.
WorldEntity
Contains mutable world, passed by ref. Provides Bevy-like API for working with entities in the world.
WorldFlushObserver
Optional observer for flush boundaries.
WorldFlushObserverBase
No-op base to simplify implementations.

Enums

ColumnKind
ComponentStorageTier
EcsActionPhase
Current execution phase for an EcsAction.
EcsFlutterScheduleReason
EcsFrameScheduleMode
EventCapacityPolicy
Capacity policy for event ring buffers when full.
ExecutionMode
Defines how a system should be executed.
QualityPreset
Quality preset used by PerformanceBudgetResource.
ScheduleExecutionPolicy

Mixins

TypedDataEventMixin
Mixin that provides field extraction for TypedDataEvent.

Extension Types

ArchetypeId
Can be integer, since this value is emphemeral and should never be saved to disk - it would be recreated specifically for the world.
ArchetypeIndex
Location of archetype in List similar to EntityIndex.
ComponentId
Internal id for Component in the world
ComponentsBatchList
ComponentsBatchList2
ComponentsBatchList3
ComponentsBatchListExt
Entity
Represents an entity (temporary runtime pointer) in the game world. Do not confuse with PersistentEntity
EntityGeneration
Represents the generation of an entity (version counter for invalidation) Incremented when entity is despawned to invalidate stale references
EntityIndex
Index of entity for faster access in lists.
PersistentEntity
Represents an savable entity in the game world. Safe to save locally.
ResourceId
Internal id for Resource in the world
ScheduleId
Typed, zero-cost identifier for a schedule.
WorldEntityExtension
Zero-cost wrapper for extension type component access.
WorldEntityMut
Provides mutable access to entity components for direct in-place mutation.
WorldId
Unique id of World

Extensions

ArchetypeBulkOps on Archetype
Bulk operations extension for Archetype
EcsBuildContextX on BuildContext
Convenient ecsly accessors on Flutter BuildContext.
EcsComponentLookupX on World
Flutter/app lookup helpers on an ecsly World.
EntityCommandsX on EntityCommands
FloatColumnSimd on FloatColumn
SIMD-optimized operations for FloatColumn.
WorldBatchSpawnX on World
WorldBulkAppendX on World
WorldCommandsX on WorldCommands
WorldComponentX on World
WorldEntityX on World
Entity management extensions for World.
WorldFlushX on World
WorldPluginX on World
WorldQueryX on World
Type-safe query extensions for World that return Dart records.
WorldResourceX on World
WorldScheduleX on World

Properties

emptyComponentMask → ComponentMask
no setter

Functions

applyQualityPreset(PerformanceBudgetResource budget, QualityPreset preset) → void
Applies a quality preset to PerformanceBudgetResource runtime controls.
calculateDistancesSimd(FloatColumn positionColumn, Float32x4 target, FloatColumn outputColumn) → void
Calculate distances between positions (SIMD-optimized).
compareDeterministicOrderKey(DeterministicOrderKey a, DeterministicOrderKey b) → int
Compares two deterministic extraction keys.
createComponentMask(Iterable<ComponentId> ids) → ComponentMask
deterministicSortedIndices(int count, {required int primary(int row), required int secondary(int row), required int tertiary(int row), required int tieBreaker(int row)}) → List<int>
Returns row indices sorted using deterministic integer keys.
flushAllSystem(World world) → void
Convenience system that runs all flush phases in the correct order.
flushAllWithTimingSystem(World world) → void
Flush system with timing instrumentation
flushCommandsSystem(World world) → void
System that executes the command queue.
flushComponentsSystem(World world) → void
System that flushes the component registry.
flushEntitiesSystem(World world) → void
System that flushes the entity registry.
flushResourcesSystem(World world) → void
System that flushes the resource registry.
nextHigherQualityPreset(QualityPreset preset) → QualityPreset
nextLowerQualityPreset(QualityPreset preset) → QualityPreset
noopSystem(World _) → void
System that does nothing
normalizeVectorsSimd(FloatColumn vectorColumn) → void
Normalize a batch of vectors (SIMD-optimized).
performanceSystem(World world) → void
Performance monitoring system: Track FPS and entity count.
reportRenderSubmitMetrics(World world, {required int submitMicros, required int drawCount, required int transformCount}) → void
Convenience helper for updating RenderSubmitMetricsResource.
scalePositionsSimd(FloatColumn positionColumn, double scale) → void
Scale all Position components by a factor.
syncScheduleExecutionFrame(World world, {int? explicitFrameId}) → void
updatePositionSimd(FloatColumn positionColumn, FloatColumn velocityColumn, double dt) → void
Update Position components using Velocity (SIMD-optimized).

Typedefs

AsyncSystem = Future<void> Function(World world)
An asynchronous system that operates on the world state.
ComponentPredicate<T> = bool Function(T component)
Type for component predicates used in conditional queries. Returns true if the component matches the condition.
DeterministicOrderKey = (int, int, int, int)
Deterministic key used to order extracted rows.
EcsActionAfterRun = FutureOr<EcsInvalidationBatch?> Function(EcsInvalidationBatch actionInvalidation)
EcsActionChanged = void Function({bool flush, EcsInvalidationBatch? invalidation})
EcsActionErrorCallback = void Function(Object error, StackTrace stack)
EcsActionRunCallback<T> = Future<T> Function()
EcsActionStatusWidgetBuilder = Widget Function(BuildContext context, EcsActionStatus status)
EcsActionWidgetBuilder<T> = Widget Function(BuildContext context, EcsActionStatus status, EcsActionRunCallback<T>? run)
EcsComponentWhere<T extends Component> = bool Function(Entity entity, T component)
EcsComponentWidgetBuilder<T extends Component> = Widget Function(BuildContext context, T component)
EcsHostSchedulePredicate = bool Function(EcsInvalidationBatch triggerInvalidation)
EcsResourceWidgetBuilder<T extends Resource> = Widget Function(BuildContext context, T resource)
EcsScheduleInvalidation = EcsInvalidationBatch? Function(String scheduleName)
EcsScheduleRunObserver = void Function(EcsScheduleRunEvent event)
EcsSelectedComponentWidgetBuilder<R> = Widget Function(BuildContext context, R value)
EcsSelectedResourceWidgetBuilder<R> = Widget Function(BuildContext context, R value)
EcsSelectedWorldWidgetBuilder<R> = Widget Function(BuildContext context, R value)
EcsValueEquals<T> = bool Function(T previous, T next)
EcsWorldSelect<R> = R Function(World world)
ExtensionPredicate<T> = bool Function(T extensionType)
Type for extension type predicates used in conditional queries. Returns true if the extension type matches the condition.
ScheduleOrderingPolicy = Iterable<String> Function(Iterable<String> scheduleNames)
System = void Function(World world)
A system is a function that operates on the world state.
TypeResourceRecord = (Type, Resource)

Exceptions / Errors

ArchetypeNotFoundError
Thrown when accessing an archetype that doesn't exist.
CircularDependencyError
Thrown when a system schedule has circular dependencies.
ComponentNotFoundError
Thrown when accessing a component that doesn't exist on an entity.
ComponentNotRegisteredError
Thrown when using a component type that hasn't been registered.
ComponentRegistrationException
Thrown when component registration fails (recoverable).
EcsActionCancelledException
Exception thrown when an action cooperatively observes cancellation.
EcsException
Base class for ECS-specific exceptions (recoverable conditions).
EcsStateError
Base class for ECS-specific state errors.
EntityNotFoundError
Thrown when accessing an entity that doesn't exist or is not alive.
EventCapacityOverflow
Thrown when event channel capacity is exceeded (recoverable).
EventColumnUnsupportedError
Thrown when column-based event storage is not supported for a column type.
EventFactoryValidationError
Thrown when event factory validation fails.
EventNotRegisteredException<T>
Thrown when accessing an event channel that hasn't been registered.
EventRegistrationException
Thrown when event registration fails (recoverable).
EventStrideCalculationError
Thrown when event stride calculation fails.
EventStrideMismatchError
Thrown when event stride doesn't match the expected stride.
EventTriggerValidationError
Thrown when EventTrigger is used with an unregistered event channel.
EventTypeMismatchError
Thrown when event type doesn't match column storage type.
ExtensionTypeMismatchError
Thrown when an extension type doesn't match the registered type for a component.
ExtensionTypeNotRegisteredError<TExtension>
Thrown when a component has no registered extension type facade.
HotScheduleObjectComponentError
Thrown when a hot schedule attempts to access an object/cold component.
IteratorNotReadyError
Thrown when an iterator is used incorrectly (not initialized or exhausted).
PluginInstallationException
Thrown when plugin installation fails (recoverable).
ScheduleTimeSourceMissingError
Thrown when a deterministic schedule trigger has no configured time source.
SystemConfigurationError
Thrown when a system configuration is invalid.