55 lines
1.6 KiB
Dart
55 lines
1.6 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
import '../../../../core/localization/app_localizations.dart';
|
||
|
|
import '../cubit/device_alarms_cubit.dart';
|
||
|
|
import 'device_alarm_dialog.dart';
|
||
|
|
import 'device_alarm_summary_card.dart';
|
||
|
|
|
||
|
|
/// 标题、右侧箭头和卡片均可打开同一设备范围的告警弹窗。
|
||
|
|
class DeviceAlarmSection extends StatelessWidget {
|
||
|
|
const DeviceAlarmSection({
|
||
|
|
super.key,
|
||
|
|
required this.cubit,
|
||
|
|
required this.deviceSn,
|
||
|
|
});
|
||
|
|
final DeviceAlarmsCubit cubit;
|
||
|
|
final String deviceSn;
|
||
|
|
|
||
|
|
@override
|
||
|
|
Widget build(BuildContext context) => Column(
|
||
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||
|
|
children: [
|
||
|
|
InkWell(
|
||
|
|
onTap: () =>
|
||
|
|
showDeviceAlarmDialog(context, cubit: cubit, deviceSn: deviceSn),
|
||
|
|
child: Padding(
|
||
|
|
padding: const EdgeInsets.symmetric(vertical: 6),
|
||
|
|
child: Row(
|
||
|
|
children: [
|
||
|
|
Expanded(
|
||
|
|
child: Text(
|
||
|
|
AppLocalizations.of(
|
||
|
|
context,
|
||
|
|
).translate('device_detail_v2.fault_state'),
|
||
|
|
style: const TextStyle(
|
||
|
|
fontSize: 15,
|
||
|
|
fontWeight: FontWeight.w800,
|
||
|
|
color: Color(0xFF1A2B4A),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const Icon(
|
||
|
|
Icons.chevron_right,
|
||
|
|
size: 20,
|
||
|
|
color: Color(0xFF1C96F6),
|
||
|
|
),
|
||
|
|
],
|
||
|
|
),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
const SizedBox(height: 4),
|
||
|
|
DeviceAlarmSummaryCard(cubit: cubit, deviceSn: deviceSn),
|
||
|
|
],
|
||
|
|
);
|
||
|
|
}
|