2026-05-19 08:46:35 +08:00
|
|
|
import 'package:flutter/material.dart';
|
2026-07-02 16:04:30 +08:00
|
|
|
import 'package:maibu_satabot_v2/core/localization/app_localizations.dart';
|
2026-05-19 08:46:35 +08:00
|
|
|
|
|
|
|
|
class QuickEntryCard extends StatelessWidget {
|
|
|
|
|
const QuickEntryCard({super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
2026-07-02 16:04:30 +08:00
|
|
|
Text(
|
|
|
|
|
AppLocalizations.of(context).translate('home_v2.quick_entry'),
|
|
|
|
|
style: const TextStyle(
|
2026-05-19 08:46:35 +08:00
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
color: Color(0xFF1D2129),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
const Icon(
|
|
|
|
|
Icons.arrow_forward_ios,
|
|
|
|
|
size: 16,
|
|
|
|
|
color: Color(0xFF86909C),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 12),
|
2026-05-25 12:58:29 +08:00
|
|
|
SizedBox(
|
|
|
|
|
height: 85,
|
|
|
|
|
child: ListView(
|
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
|
physics: const BouncingScrollPhysics(),
|
|
|
|
|
padding: const EdgeInsets.only(right: 16),
|
2026-05-19 08:46:35 +08:00
|
|
|
children: [
|
2026-05-25 12:58:29 +08:00
|
|
|
_buildQuickEntryCard(
|
2026-05-19 08:46:35 +08:00
|
|
|
icon: Icons.upload_file,
|
2026-07-02 16:04:30 +08:00
|
|
|
label: AppLocalizations.of(
|
|
|
|
|
context,
|
|
|
|
|
).translate('home_v2.device_report'),
|
2026-05-19 08:46:35 +08:00
|
|
|
),
|
2026-05-25 12:58:29 +08:00
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
_buildQuickEntryCard(
|
2026-05-19 08:46:35 +08:00
|
|
|
icon: Icons.qr_code_scanner,
|
2026-07-02 16:04:30 +08:00
|
|
|
label: AppLocalizations.of(
|
|
|
|
|
context,
|
|
|
|
|
).translate('home_v2.scan_qr'),
|
2026-05-19 08:46:35 +08:00
|
|
|
),
|
2026-05-25 12:58:29 +08:00
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
_buildQuickEntryCard(
|
2026-05-19 08:46:35 +08:00
|
|
|
icon: Icons.assignment,
|
2026-07-02 16:04:30 +08:00
|
|
|
label: AppLocalizations.of(
|
|
|
|
|
context,
|
|
|
|
|
).translate('home_v2.work_order'),
|
2026-05-19 08:46:35 +08:00
|
|
|
),
|
2026-05-25 12:58:29 +08:00
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
_buildQuickEntryCard(
|
2026-05-19 08:46:35 +08:00
|
|
|
icon: Icons.notifications_active,
|
2026-07-02 16:04:30 +08:00
|
|
|
label: AppLocalizations.of(
|
|
|
|
|
context,
|
|
|
|
|
).translate('home_v2.alarm_center'),
|
2026-05-19 08:46:35 +08:00
|
|
|
),
|
2026-05-25 12:58:29 +08:00
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
_buildQuickEntryCard(
|
|
|
|
|
icon: Icons.map,
|
2026-07-02 16:04:30 +08:00
|
|
|
label: AppLocalizations.of(
|
|
|
|
|
context,
|
|
|
|
|
).translate('home_v2.power_plant_map'),
|
2026-05-25 12:58:29 +08:00
|
|
|
),
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
_buildQuickEntryCard(
|
|
|
|
|
icon: Icons.devices,
|
2026-07-02 16:04:30 +08:00
|
|
|
label: AppLocalizations.of(
|
|
|
|
|
context,
|
|
|
|
|
).translate('home_v2.device_list'),
|
2026-05-25 12:58:29 +08:00
|
|
|
),
|
|
|
|
|
const SizedBox(width: 8),
|
2026-05-19 08:46:35 +08:00
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-02 16:04:30 +08:00
|
|
|
Widget _buildQuickEntryCard({required IconData icon, required String label}) {
|
2026-05-19 08:46:35 +08:00
|
|
|
return InkWell(
|
|
|
|
|
onTap: () => print('点击:$label'),
|
2026-05-25 12:58:29 +08:00
|
|
|
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),
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-05-19 08:46:35 +08:00
|
|
|
),
|
2026-05-25 12:58:29 +08:00
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
children: [
|
2026-07-02 16:04:30 +08:00
|
|
|
Icon(icon, color: const Color(0xFF165DFF), size: 26),
|
2026-05-25 12:58:29 +08:00
|
|
|
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,
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-05-19 08:46:35 +08:00
|
|
|
),
|
2026-05-25 12:58:29 +08:00
|
|
|
),
|
2026-05-19 08:46:35 +08:00
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|