NiceViewService class

Service for loading, caching, and hot-swapping ERP view definitions.

final service = NiceViewService(
  config: NiceViewServiceConfig(baseUrl: 'https://api.example.com'),
  transport: MyHttpTransport(),
  cache: NiceViewCache(storage: NiceInMemoryCacheStorage()),
);

// Load a view (with cache + delta support)
final result = await service.loadView('inventory', 'stock-list');

// Listen for hot-swap updates
service.onViewUpdated.listen((viewId) { /* refresh */ });

Constructors

NiceViewService({required NiceViewServiceConfig config, required NiceHttpTransport transport, NiceViewCache? cache})

Properties

cache NiceViewCache
final
config NiceViewServiceConfig
final
hashCode int
The hash code for this object.
no setterinherited
onViewUpdated Stream<String>
Stream of view IDs that have been updated (hot-swapped).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transport NiceHttpTransport
final

Methods

checkForUpdate(String module, String viewId) Future<bool>
Hot-swap: poll for updates and notify listeners.
dispose() → void
loadView(String module, String viewId) Future<NiceViewLoadResult>
Load a view definition from server or cache.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refreshView(String module, String viewId) Future<NiceViewLoadResult>
Force-refresh a view from server (ignoring cache).
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited