isSceneType function

bool isSceneType(
  1. SceneType? currentScene,
  2. dynamic targetScenes
)

直接通过 SceneType 判断是否属于指定场景

Check if the scene type matches the specified scene or scene list

Implementation

bool isSceneType(
  SceneType? currentScene,
  dynamic targetScenes, // 支持 SceneType 或 List<SceneType>
) {
  final scenes = _normalizeScenes(targetScenes);
  return currentScene != null && scenes.contains(currentScene);
}