fleetDevicesApiProvider top-level property

FutureProvider<List<DeviceDTO>> fleetDevicesApiProvider
final

API Families

Implementation

final fleetDevicesApiProvider = FutureProvider<List<DeviceDTO>>((ref) async {
  final trace = ref.watch(enablePerformanceTracingProvider)
      ? FirebasePerformance.instance.newTrace('load_time_dashboard')
      : null;

  await trace?.start(); // Record
  // }
  final time = DateTime.now();
  final devices = await ref
      .watch(energyManagementV3ApiProvider.future)
      .then(
        (api) => api.kemApiV3DealerDevicesGet(),
      )
      .then(responseToValue);
  final DateTime appEndTime = DateTime.now();

  final int durationInSeconds = appEndTime.difference(time).inSeconds;

  trace?.setMetric('login_load_time_of_app_dashboard', durationInSeconds);
  await trace?.stop();

  return devices;
});