2.优化修改了tcp重连机制,具体操作:断开重连时候不再建立新链接 而是将旧链接重置,并重新发送数据。 3.大面积的给项目中的各个页面 手动接入了多语言的支持。同时也调整了相应带来的问题英文长度较大影响原有的样式的问题,已解决了对应的样式不和谐问题。保证了外观的统一性。 4.给项目中的主要操作加了几个核心的操作比如远程遥控和路径规划添加了双层的保护,设置里安全模式,即在此期间对服务器推送的重复登录操作后的自动退出登录做一个拦截 保证操作的安全性。
130 lines
4.0 KiB
Dart
130 lines
4.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:maibu_satabot_v2/core/localization/app_localizations.dart';
|
|
|
|
class QuickEntryCard extends StatelessWidget {
|
|
const QuickEntryCard({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
Text(
|
|
AppLocalizations.of(context).translate('home_v2.quick_entry'),
|
|
style: const TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
color: Color(0xFF1D2129),
|
|
),
|
|
),
|
|
const Icon(
|
|
Icons.arrow_forward_ios,
|
|
size: 16,
|
|
color: Color(0xFF86909C),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 12),
|
|
SizedBox(
|
|
height: 85,
|
|
child: ListView(
|
|
scrollDirection: Axis.horizontal,
|
|
physics: const BouncingScrollPhysics(),
|
|
padding: const EdgeInsets.only(right: 16),
|
|
children: [
|
|
_buildQuickEntryCard(
|
|
icon: Icons.upload_file,
|
|
label: AppLocalizations.of(
|
|
context,
|
|
).translate('home_v2.device_report'),
|
|
),
|
|
const SizedBox(width: 8),
|
|
_buildQuickEntryCard(
|
|
icon: Icons.qr_code_scanner,
|
|
label: AppLocalizations.of(
|
|
context,
|
|
).translate('home_v2.scan_qr'),
|
|
),
|
|
const SizedBox(width: 8),
|
|
_buildQuickEntryCard(
|
|
icon: Icons.assignment,
|
|
label: AppLocalizations.of(
|
|
context,
|
|
).translate('home_v2.work_order'),
|
|
),
|
|
const SizedBox(width: 8),
|
|
_buildQuickEntryCard(
|
|
icon: Icons.notifications_active,
|
|
label: AppLocalizations.of(
|
|
context,
|
|
).translate('home_v2.alarm_center'),
|
|
),
|
|
const SizedBox(width: 8),
|
|
_buildQuickEntryCard(
|
|
icon: Icons.map,
|
|
label: AppLocalizations.of(
|
|
context,
|
|
).translate('home_v2.power_plant_map'),
|
|
),
|
|
const SizedBox(width: 8),
|
|
_buildQuickEntryCard(
|
|
icon: Icons.devices,
|
|
label: AppLocalizations.of(
|
|
context,
|
|
).translate('home_v2.device_list'),
|
|
),
|
|
const SizedBox(width: 8),
|
|
],
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
Widget _buildQuickEntryCard({required IconData icon, required String label}) {
|
|
return InkWell(
|
|
onTap: () => print('点击:$label'),
|
|
borderRadius: BorderRadius.circular(12),
|
|
child: SizedBox(
|
|
width: 85,
|
|
height: 85,
|
|
child: Container(
|
|
padding: const EdgeInsets.all(10),
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(12),
|
|
boxShadow: const [
|
|
BoxShadow(
|
|
color: Color(0x0D000000),
|
|
blurRadius: 4,
|
|
offset: Offset(0, 2),
|
|
),
|
|
],
|
|
),
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Icon(icon, color: const Color(0xFF165DFF), size: 26),
|
|
const SizedBox(height: 6),
|
|
Text(
|
|
label,
|
|
textAlign: TextAlign.center,
|
|
style: const TextStyle(
|
|
color: Color(0xFF4E5969),
|
|
fontSize: 12,
|
|
height: 1.2,
|
|
),
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|