buildSceneDisplayTitle function

String buildSceneDisplayTitle({
  1. required String? title,
  2. String? filePath,
  3. String? streamPath,
  4. String fallback = 'Untitled Scene',
})

Implementation

String buildSceneDisplayTitle({
  required String? title,
  String? filePath,
  String? streamPath,
  String fallback = 'Untitled Scene',
}) {
  final trimmed = title?.trim() ?? '';
  if (trimmed.isNotEmpty) return trimmed;

  final fromPath = _nameFromPath(filePath) ?? _nameFromPath(streamPath);
  return (fromPath == null || fromPath.isEmpty) ? fallback : fromPath;
}