mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Created an interface and its fake implementation for loading device location data.
This commit is contained in:
@ -0,0 +1,6 @@
|
||||
import 'package:syncrow_web/pages/analytics/models/device_location_info.dart';
|
||||
import 'package:syncrow_web/pages/analytics/params/get_device_location_data_param.dart';
|
||||
|
||||
abstract interface class DeviceLocationService {
|
||||
Future<DeviceLocationInfo> get(GetDeviceLocationDataParam param);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
import 'package:syncrow_web/pages/analytics/models/device_location_info.dart';
|
||||
import 'package:syncrow_web/pages/analytics/params/get_device_location_data_param.dart';
|
||||
import 'package:syncrow_web/pages/analytics/services/device_location/device_location_service.dart';
|
||||
|
||||
class FakeDeviceLocationService implements DeviceLocationService {
|
||||
const FakeDeviceLocationService();
|
||||
|
||||
@override
|
||||
Future<DeviceLocationInfo> get(GetDeviceLocationDataParam param) async {
|
||||
return await Future.delayed(
|
||||
const Duration(milliseconds: 500),
|
||||
() => const DeviceLocationInfo(
|
||||
airQuality: 45.0,
|
||||
humidity: 65.0,
|
||||
city: 'Dubai',
|
||||
country: 'UAE',
|
||||
address: 'Business Bay',
|
||||
temperature: 22.5,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user