state method

void state(
  1. String name,
  2. DslType type, {
  3. String? description,
  4. bool persisted = false,
})

Declares one global app-state field.

Implementation

void state(
  String name,
  DslType type, {
  String? description,
  bool persisted = false,
}) {
  _ensureUnique(_appStateNames, name, 'app state');
  _appState.add(
    AppStateDeclaration(
      name: name,
      description: description,
      type: type,
      persisted: persisted,
    ),
  );
}