mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-07-09 02:30:14 +08:00
feat: login devices
Closes #1140 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
14
lib/models_new/login_devices/data.dart
Normal file
14
lib/models_new/login_devices/data.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
import 'package:PiliPlus/models_new/login_devices/device.dart';
|
||||
|
||||
class LoginDevicesData {
|
||||
List<LoginDevice>? devices;
|
||||
|
||||
LoginDevicesData({this.devices});
|
||||
|
||||
factory LoginDevicesData.fromJson(Map<String, dynamic> json) =>
|
||||
LoginDevicesData(
|
||||
devices: (json['devices'] as List<dynamic>?)
|
||||
?.map((e) => LoginDevice.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
}
|
||||
32
lib/models_new/login_devices/device.dart
Normal file
32
lib/models_new/login_devices/device.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
class LoginDevice {
|
||||
int? mid;
|
||||
String? localId;
|
||||
String? deviceName;
|
||||
String? devicePlatform;
|
||||
bool? isCurrentDevice;
|
||||
String? latestLoginAt;
|
||||
String? source;
|
||||
int? origin;
|
||||
|
||||
LoginDevice({
|
||||
this.mid,
|
||||
this.localId,
|
||||
this.deviceName,
|
||||
this.devicePlatform,
|
||||
this.isCurrentDevice,
|
||||
this.latestLoginAt,
|
||||
this.source,
|
||||
this.origin,
|
||||
});
|
||||
|
||||
factory LoginDevice.fromJson(Map<String, dynamic> json) => LoginDevice(
|
||||
mid: json['mid'] as int?,
|
||||
localId: json['local_id'] as String?,
|
||||
deviceName: json['device_name'] as String?,
|
||||
devicePlatform: json['device_platform'] as String?,
|
||||
isCurrentDevice: json['is_current_device'] as bool?,
|
||||
latestLoginAt: json['latest_login_at'] as String?,
|
||||
source: json['source'] as String?,
|
||||
origin: json['origin'] as int?,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user