fcmSelectCamera function
CameraDescription?
fcmSelectCamera({})
Implementation
CameraDescription? fcmSelectCamera({
required Iterable<CameraDescription> cameras,
String? name,
CameraLensDirection? lensDirection,
}) {
if (name != null) {
final found = cameras.firstWhereOrNull(
(c) => c.name == name,
);
if (found != null) return found;
}
if (lensDirection != null) {
final found = cameras.firstWhereOrNull(
(c) => c.lensDirection == lensDirection,
);
if (found != null) return found;
}
return cameras.firstOrNull;
}