createState method

  1. @override
CellState<StatefulCell> createState()
override

Create the CellState for this cell.

This method should be overridden by subclasses.

Implementation

@override
CellState<StatefulCell> createState() {
  if (_restoredState != null) {
    final state = _restoredState;
    _restoredState = null;

    return state!;
  }

  if (changesOnly) {
    return StoreCellChangesOnlyState<T>(
        cell: this,
        key: key
    );
  }

  return StoreCellState<T>(
      cell: this,
      key: key
  );
}