- 添加 video_player 依赖,实现 OSS 视频播放 - 故事有 has_video 时自动切换到绘本 Tab 并初始化播放器 - 修复播放按钮尺寸及 GestureDetector 事件穿透问题 - TTSService 新增 errorTitle 字段,避免跨故事错误状态污染 - 修复 device entity 相关代码 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
57 lines
1.4 KiB
Dart
57 lines
1.4 KiB
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|
|
|
part 'device.freezed.dart';
|
|
part 'device.g.dart';
|
|
|
|
@freezed
|
|
abstract class DeviceType with _$DeviceType {
|
|
const factory DeviceType({
|
|
required int id,
|
|
required String brand,
|
|
required String productCode,
|
|
required String name,
|
|
@Default(true) bool isNetworkRequired,
|
|
@Default(true) bool isActive,
|
|
String? createdAt,
|
|
}) = _DeviceType;
|
|
|
|
factory DeviceType.fromJson(Map<String, dynamic> json) =>
|
|
_$DeviceTypeFromJson(json);
|
|
}
|
|
|
|
@freezed
|
|
abstract class DeviceInfo with _$DeviceInfo {
|
|
const factory DeviceInfo({
|
|
required int id,
|
|
required String sn,
|
|
DeviceType? deviceType,
|
|
DeviceType? deviceTypeInfo,
|
|
String? macAddress,
|
|
@Default('') String name,
|
|
@Default('in_stock') String status,
|
|
@Default(false) bool isOnline,
|
|
@Default('') String firmwareVersion,
|
|
String? lastOnlineAt,
|
|
String? createdAt,
|
|
}) = _DeviceInfo;
|
|
|
|
factory DeviceInfo.fromJson(Map<String, dynamic> json) =>
|
|
_$DeviceInfoFromJson(json);
|
|
}
|
|
|
|
@freezed
|
|
abstract class UserDevice with _$UserDevice {
|
|
const factory UserDevice({
|
|
required int id,
|
|
required DeviceInfo device,
|
|
int? spirit,
|
|
String? spiritName,
|
|
@Default('owner') String bindType,
|
|
String? bindTime,
|
|
@Default(true) bool isActive,
|
|
}) = _UserDevice;
|
|
|
|
factory UserDevice.fromJson(Map<String, dynamic> json) =>
|
|
_$UserDeviceFromJson(json);
|
|
}
|