fcmRoot function

Future<FcmRoot> fcmRoot({
  1. required TaskQueue permissionQueue,
})

Implementation

Future<FcmRoot> fcmRoot({
  required TaskQueue permissionQueue,
}) async {
  Future<IList<CameraDescription>> fetch() async =>
      (await availableCameras()).toIList();
  final camerasFw = fw(await fetch());
  return FcmRoot(
    permissionQueue: permissionQueue,
    availableCameras: camerasFw,
    refresh: () async {
      return (await fetch()).also(camerasFw.set);
    },
  );
}