import 'package:flutter/material.dart'; import 'package:go_router/go_router.dart'; class ProductPage extends StatefulWidget { const ProductPage({super.key}); @override State createState() => _ProductPageState(); } class _ProductPageState extends State { // 当前显示内容:0=主菜单 1=产品亮点 2=功能介绍 3=产品参数 4=应用场景 int currentPage = 0; // 功能介绍列表 final List funcList = const [ '两轮驱动履带式行走系统,超强地形适应能力,无极变速,轻松爬坡越障,履带爬坡角度≤35°,履带前仰角40°,垂直越障≤15cm。', '3kW闭环无刷电机独立驱动行走系统,高速传动装置效率达到95%以上,整机扭矩达到175N·m,轻松爬坡越障。闭环车速控制和检测系统,0-4km/h无级变速。', '坦克履型设计,接近角达到45°,超强地形适应能力,爬坡角度≤40°,垂直越障≤15cm;复合材料履带,抗拉强度高、抗切能力好,抗磨损;接地比压小,轻松通过烂泥沼泽地。', '方向速度手动操作模式(MT)和方向速度自动操作模式(AT)满足不同操作者使用习惯和场景使用方式。', '自主研发自适应增程系统,根据负载变化调整输出功率,节省能耗,尖峰抑制稳流系统,实现稳定电力输出配备大功率风冷发电机和过滤系统,可实现大功率交直流放电,满足长时间使用要求。', '户外等级控制箱,操作面板集中布置,防护等级IP55,操作、故障排査信息和注意事项醒目张贴,方便操作和检修。', '工业级遥控器,防护等级IP65,有跌落防误碰保护;标准433MHz波段,无需无线电备案,直接使用;遥控信号绕障和穿越能力强,抗干扰能力强,同一空间至少支持100台机器同时作业,遥控距离达到500m;锂离子充电电池,可充可换,满足各种需要。', '整机三色灯显示机器各种状态,包括油量预警、电量预警、直行保持、电控箱温度预警和安全倾角预警等;遥控实现整机操控,包括发动机一键启停、行走操控、速度操控、割盘升降和割刀转速等;遥控显示屏实时显示作业状态,包括作业时间、保养提醒、驱动器情况、作业模式、行驶模式、安全倾角检测、障碍物检测车灯状态、信号强度和遥控器电量等。', ]; // 产品亮点 final List> starPoints = const [ {'title': '整机设计', 'content': '承载式车身、高效大功率行走系统、坦克履型、油电混动、防溜坡系统、主被动溜坡浮动式刀盘、空气辅助式提升机构、自适应割草装置'}, {'title': '控制系统', 'content': '车规级控制和电气系统、工业级防干扰遥控系统、车速控制和检测系统、牵引力控制系统、手动和自动行驶操作模式、整机状态液晶显示。'}, {'title': '动力系统', 'content': '自适应增程系统、本田顶级发动机、大功率交直流放电功能。'}, {'title': '安全配置', 'content': '车身稳定系统、ABS刹车装置、电子防翻滚功能、倾斜保护功能、急速、坠落和翻滚停机功能、无操作自动关机。'}, {'title': '智能功能', 'content': '直行保持功能、防碰撞功能、碰撞停机功能。'}, {'title': '扩展功能', 'content': '路径规划、巡检探测、物联控制。'}, ]; // 应用场景 final List> sceneList = const [ {'img': 'assets/images/scene4.png', 'title': '果园林业'}, {'img': 'assets/images/scene1.png', 'title': '光伏储能'}, {'img': 'assets/images/scene2.png', 'title': '公路路政'}, {'img': 'assets/images/scene3.png', 'title': '农业生产'}, {'img': 'assets/images/scene5.png', 'title': '市政河堤'}, {'img': 'assets/images/scene6.png', 'title': '机场场所'}, ]; // 产品参数 markdown final String productParamMd = ''' # 整车信息 | 项目 | 单位 | MC700 | | ---- | ---- | ---- | | 外形尺寸(长×宽×高) | mm | 1429×1090×650 | | 车体重量 | kg | 320 | | 工作效率 | m²/h | 2500¹ | | 最低离地高度 | mm | 90 | | 续航能力(纯电) | h | 0.5 | | 水平运动额定负载 | kg | 500 | | 动力源 | | 混合动力 | | 整机显示信息 | | 电量、电压、温度 | | 遥控器显示信息 | | 电量、失联报警 | | 电池品牌 | | 理士 | | 电芯成分 | | SLA(密封铅酸可充电电池) | | 电池容量(20小时率) | Ah/hr | 23 | | 低电量报警 | | 显示屏和三色灯 | | 增程器 | | 自适应 | | 发电机保护 | | 过滤网 | | 外放电源 | V/W | 24/480(直流) | | 外放电源接口 | | 点烟器 | | 按钮 | | 304不锈钢带灯 | | 箱内电气 | | 防震端子 | | 箱外电气 | | 车规级线束 | | 防护等级 | | IP55 | # 控制系统 | 项目 | 单位 | MC700 | | ---- | ---- | ---- | | 控制器 | | ECU | | 遥控器 | | 工业级数显屏 | | 遥控距离 | m | ≤500 | | 遥控信号 | MHz | 433 | | 通信频率 | Hz | 10 | | 发动机维护提醒 | | 屏幕图标提醒 | | 自动驻车 | kg | 有 | | 坡道辅助起步 | | 有 | | 车身倾斜检测| | 有 | | 车速检测系统 | | 有 | | ABS刹车系统 | | 有 | | 电子防御滚系统 | | 有 | | 牵引力控制系统| | 有 | | 车身稳定系统| | 有 | | 抗干扰 || 百台设备互不干扰 | | 传感器安装预留 | |LIDAR/CPS/RIDAR | | 防护等级| |车规级ip65 | '''; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: const Color(0xFFF7F8FA), // 全局背景色 body: Column( children: [ _buildHeader(), Expanded(child: _buildContent()), ], ), ); } Widget _buildHeader() { String title = '产品介绍'; if (currentPage == 1) title = '产品亮点'; if (currentPage == 2) title = '功能介绍'; if (currentPage == 3) title = '产品参数'; if (currentPage == 4) title = '应用场景'; return Container( padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top + 8, bottom: 12, left: 4, right: 4), decoration: const BoxDecoration( color: Colors.white, boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 4, offset: Offset(0, 2))], ), child: Row( children: [ if (currentPage != 0) IconButton( onPressed: () => setState(() => currentPage = 0), icon: const Icon(Icons.arrow_back_ios, size: 18, color: Color(0xFF333333)), ), if (currentPage == 0) IconButton( onPressed: () => context.pop(), icon: const Icon(Icons.arrow_back_ios, size: 18, color: Color(0xFF333333)), ), Expanded( child: Text( title, textAlign: TextAlign.center, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600, color: Color(0xFF333333)), ), ), if (currentPage != 0) const SizedBox(width: 48), ], ), ); } Widget _buildContent() { switch (currentPage) { case 1: return _buildStarPoint(); case 2: return _buildFunction(); case 3: return _buildParam(); case 4: return _buildScene(); default: return _buildMainMenu(); } } // 主菜单(卡片样式) Widget _buildMainMenu() { return ListView( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), children: [ _menuItem('产品亮点', Icons.highlight_outlined, 1), _menuItem('功能介绍', Icons.widgets_outlined, 2), _menuItem('产品参数', Icons.table_chart_outlined, 3), _menuItem('应用场景', Icons.place_outlined, 4), ], ); } Widget _menuItem(String title, IconData icon, int page) { return Container( margin: const EdgeInsets.only(bottom: 10), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 6, offset: const Offset(0, 2))], ), child: InkWell( borderRadius: BorderRadius.circular(12), onTap: () => setState(() => currentPage = page), child: Padding( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: Row( children: [ Icon(icon, size: 24, color: const Color(0xFF4A90E2)), const SizedBox(width: 12), Text(title, style: const TextStyle(fontSize: 16, color: Color(0xFF333333))), const Spacer(), const Icon(Icons.arrow_forward_ios, size: 14, color: Colors.grey), ], ), ), ), ); } // 产品亮点(卡片+主题色) Widget _buildStarPoint() { return ListView( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), children: [ ...starPoints.map((item) { return Container( margin: const EdgeInsets.only(bottom: 10), padding: const EdgeInsets.all(16), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 4)], ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ const Icon(Icons.star_rounded, color: Color(0xFF4A90E2), size: 20), const SizedBox(width: 6), Text(item['title']!, style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w600)), ], ), const SizedBox(height: 6), Text(item['content']!, style: const TextStyle(color: Color(0xFF666666), height: 1.4)), ], ), ); }), const SizedBox(height: 16), ClipRRect(borderRadius: BorderRadius.circular(12), child: Image.asset('assets/images/startpoint.png')), const SizedBox(height: 20), ], ); } // 功能介绍(卡片+项目符号) Widget _buildFunction() { return ListView( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), children: [ Container( padding: const EdgeInsets.all(16), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 4)], ), child: Column( children: [ ...funcList.map((text) { return Padding( padding: const EdgeInsets.only(bottom: 10), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ const Text('• ', style: TextStyle(color: Color(0xFF4A90E2), fontSize: 16)), Expanded( child: Text(text, style: const TextStyle(color: Color(0xFF444444), height: 1.45)), ), ], ), ); }), ], ), ), const SizedBox(height: 20), ], ); } // 产品参数(优化表格样式) Widget _buildParam() { return SingleChildScrollView( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ const Text( ' 整车信息', style: TextStyle(fontSize: 17, fontWeight: FontWeight.w600, color: Color(0xFF333333)), ), const SizedBox(height: 8), _buildVehicleInfoTable(), const SizedBox(height: 20), const Text( ' 控制系统', style: TextStyle(fontSize: 17, fontWeight: FontWeight.w600, color: Color(0xFF333333)), ), const SizedBox(height: 8), _buildControlSystemTable(), const SizedBox(height: 30), ], ), ); } Widget _buildVehicleInfoTable() { return SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 4)], ), child: Table( border: TableBorder.all(color: Colors.grey.shade200, width: 1), columnWidths: const {0: FixedColumnWidth(200), 1: FixedColumnWidth(80), 2: FixedColumnWidth(160)}, children: [ TableRow( decoration: BoxDecoration(color: Colors.grey.shade50), children: const [ Padding( padding: EdgeInsets.all(10), child: Text('项目', style: TextStyle(fontWeight: FontWeight.w600)), ), Padding( padding: EdgeInsets.all(10), child: Text('单位', style: TextStyle(fontWeight: FontWeight.w600)), ), Padding( padding: EdgeInsets.all(10), child: Text('MC700', style: TextStyle(fontWeight: FontWeight.w600)), ), ], ), ...[ _buildTableRow('外形尺寸(长×宽×高)', 'mm', '1429×1090×650'), _buildTableRow('车体重量', 'kg', '320'), _buildTableRow('工作效率', 'm²/h', '2500¹'), _buildTableRow('最低离地高度', 'mm', '90'), _buildTableRow('续航能力(纯电)', 'h', '0.5'), _buildTableRow('水平运动额定负载', 'kg', '500'), _buildTableRow('动力源', '', '混合动力'), _buildTableRow('整机显示信息', '', '电量、电压、温度'), _buildTableRow('遥控器显示信息', '', '电量、失联报警'), _buildTableRow('电池品牌', '', '理士'), _buildTableRow('电芯成分', '', 'SLA(密封铅酸可充电电池)'), _buildTableRow('电池容量(20小时率)', 'Ah/hr', '23'), _buildTableRow('低电量报警', '', '显示屏和三色灯'), _buildTableRow('增程器', '', '自适应'), _buildTableRow('发电机保护', '', '过滤网'), _buildTableRow('外放电源', 'V/W', '24/480(直流)'), _buildTableRow('外放电源接口', '', '点烟器'), _buildTableRow('按钮', '', '304不锈钢带灯'), _buildTableRow('箱内电气', '', '防震端子'), _buildTableRow('箱外电气', '', '车规级线束'), _buildTableRow('防护等级', '', 'IP55'), ], ], ), ), ); } Widget _buildControlSystemTable() { return SingleChildScrollView( scrollDirection: Axis.horizontal, child: Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(10), boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 4)], ), child: Table( border: TableBorder.all(color: Colors.grey.shade200, width: 1), columnWidths: const {0: FixedColumnWidth(200), 1: FixedColumnWidth(80), 2: FixedColumnWidth(160)}, children: [ TableRow( decoration: BoxDecoration(color: Colors.grey.shade50), children: const [ Padding( padding: EdgeInsets.all(10), child: Text('项目', style: TextStyle(fontWeight: FontWeight.w600)), ), Padding( padding: EdgeInsets.all(10), child: Text('单位', style: TextStyle(fontWeight: FontWeight.w600)), ), Padding( padding: EdgeInsets.all(10), child: Text('MC700', style: TextStyle(fontWeight: FontWeight.w600)), ), ], ), ...[ _buildTableRow('控制器', '', 'ECU'), _buildTableRow('遥控器', '', '工业级数显屏'), _buildTableRow('遥控距离', 'm', '≤500'), _buildTableRow('遥控信号', 'MHz', '433'), _buildTableRow('通信频率', 'Hz', '10'), _buildTableRow('发动机维护提醒', '', '屏幕图标提醒'), _buildTableRow('自动驻车', 'kg', '有'), _buildTableRow('坡道辅助起步', '', '有'), _buildTableRow('车身倾斜检测', '', '有'), _buildTableRow('车速检测系统', '', '有'), _buildTableRow('ABS刹车系统', '', '有'), _buildTableRow('电子防御滚系统', '', '有'), _buildTableRow('牵引力控制系统', '', '有'), _buildTableRow('车身稳定系统', '', '有'), _buildTableRow('抗干扰', '', '百台设备互不干扰'), _buildTableRow('传感器安装预留', '', 'LIDAR/CPS/RIDAR'), _buildTableRow('防护等级', '', '车规级ip65'), ], ], ), ), ); } TableRow _buildTableRow(String item, String unit, String value) { return TableRow( children: [ Padding(padding: const EdgeInsets.all(10), child: Text(item)), Padding(padding: const EdgeInsets.all(10), child: Text(unit)), Padding(padding: const EdgeInsets.all(10), child: Text(value)), ], ); } // 应用场景(卡片网格) Widget _buildScene() { return GridView.builder( padding: const EdgeInsets.all(12), gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2, mainAxisSpacing: 10, crossAxisSpacing: 10, childAspectRatio: 0.9), itemCount: sceneList.length, itemBuilder: (ctx, index) { final item = sceneList[index]; return Container( decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(12), boxShadow: [BoxShadow(color: Colors.black12, blurRadius: 4)], ), child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ ClipRRect( borderRadius: BorderRadius.circular(8), child: Image.asset(item['img']!, height: 100, fit: BoxFit.cover), ), const SizedBox(height: 10), Text(item['title']!, style: const TextStyle(fontSize: 15, fontWeight: FontWeight.w500)), ], ), ); }, ); } }