addScene method

DiveScene addScene(
  1. DiveScene scene
)

Add a scene and set it as the currentScene if null.

Implementation

DiveScene addScene(DiveScene scene) {
  updateState((state) {
    return state.copyWith(scenes: state.scenes.toList()..add(scene));
  });
  if (state.currentScene == null) {
    updateState((state) => state.copyWith(currentScene: scene));
  }
  return scene;
}