机器人的列表接口
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/waring_center/presentation/bloc/alarm_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/waring_center/presentation/bloc/alarm_state.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/waring_center/presentation/constants/alarm_constants.dart';
|
||||
@@ -101,8 +102,7 @@ class _AlarmCenterPageState extends State<AlarmCenterPage> {
|
||||
return AlarmItemCard(
|
||||
alarm: alarm,
|
||||
onTap: () {
|
||||
// TODO: 跳转到告警详情页
|
||||
debugPrint('点击告警: ${alarm.title}');
|
||||
context.push('/alarm_center/detail/${alarm.id}');
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
@@ -213,6 +213,35 @@ class _AlarmCenterPageState extends State<AlarmCenterPage> {
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
// 铃铛图标(消息通知)
|
||||
Stack(
|
||||
children: [
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.notifications_none,
|
||||
size: 24,
|
||||
color: Color(0xFF1D2129),
|
||||
),
|
||||
onPressed: () {
|
||||
context.push('/message_center');
|
||||
},
|
||||
),
|
||||
// 未读消息红点
|
||||
Positioned(
|
||||
right: 10,
|
||||
top: 10,
|
||||
child: Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFFF53F3F),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// 筛选图标
|
||||
IconButton(
|
||||
icon: const Icon(
|
||||
Icons.filter_list,
|
||||
|
||||
@@ -1,13 +1,37 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:maibu_satabot_v2/core/di/injection.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/message_center/presentation/pages/message_center_page.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/waring_center/presentation/bloc/alarm_detail_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/waring_center/presentation/pages/alarm_center_page.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/waring_center/presentation/pages/alarm_detail_page.dart';
|
||||
|
||||
/// 告警中心路由配置
|
||||
class AlarmCenterRoutes {
|
||||
static List<RouteBase> get routes => [
|
||||
GoRoute(
|
||||
path: 'alarm_center',
|
||||
path: '/alarm_center',
|
||||
name: 'alarmCenter',
|
||||
builder: (context, state) => const AlarmCenterPage(),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: 'detail/:alarmId',
|
||||
name: 'alarmDetail',
|
||||
builder: (context, state) {
|
||||
final alarmId = state.pathParameters['alarmId']!;
|
||||
return BlocProvider(
|
||||
create: (_) => sl<AlarmDetailCubit>(),
|
||||
child: AlarmDetailPage(alarmId: alarmId),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
// 消息中心页路由
|
||||
GoRoute(
|
||||
path: '/message_center',
|
||||
name: 'messageCenter',
|
||||
builder: (context, state) => const MessageCenterPage(),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user