import 'package:flutter/material.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: [ const Text( '快捷入口', style: 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: '设备上报', ), const SizedBox(width: 8), _buildQuickEntryCard( icon: Icons.qr_code_scanner, label: '扫一扫', ), const SizedBox(width: 8), _buildQuickEntryCard( icon: Icons.assignment, label: '工单任务', ), const SizedBox(width: 8), _buildQuickEntryCard( icon: Icons.notifications_active, label: '告警中心', ), const SizedBox(width: 8), _buildQuickEntryCard( icon: Icons.map, label: '电厂地图', ), const SizedBox(width: 8), _buildQuickEntryCard( icon: Icons.devices, label: '设备列表', ), 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, ), ], ), ), ), ); } }