import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import '../controllers/meeting_details_controller.dart'; class AIBottomSheet extends StatefulWidget { const AIBottomSheet({super.key}); @override State createState() => _AIBottomSheetState(); } class _AIBottomSheetState extends State { final _controller = Get.find(); List _dataList = []; final List _cruxList = [ '添加代办事项', '提取结论', '生成关键指标', ]; @override Widget build(BuildContext context) { return Container( height: 1.sh - 50.h, padding: EdgeInsets.symmetric(horizontal: 12.w), child: Column( children: [ Container( padding: EdgeInsets.symmetric(vertical: 10.w), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ 26.horizontalSpace, Text( 'Ask AI', style: TextStyle( fontSize: 16.sp, color: Colors.black87, fontWeight: FontWeight.bold, ), ), GestureDetector( onTap: () => Get.back(), child: Container( width: 26.w, height: 26.w, decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(26.r), ), child: Icon( Icons.close, size: 18.w, color: Colors.grey[400], ), ), ) ], ), ), Expanded( child: _dataList.isNotEmpty ? SizedBox() : _empty(), ), _inputBox(), ], ), ); } Widget _empty() { return Padding( padding: EdgeInsets.symmetric(vertical: 10.w), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( '今天我能帮您做点什么呢?', style: TextStyle( fontSize: 18.sp, fontWeight: FontWeight.bold, ), ), Padding( padding: EdgeInsets.only(top: 10.w, bottom: 30.w), child: Row( children: [ Icon( Icons.audio_file_outlined, size: 14.w, color: Colors.grey[500], ), 2.horizontalSpace, Text( _controller.meetingData.value.title, style: TextStyle( color: Colors.grey[500], fontSize: 12.sp, ), ), ], ), ), ...List.generate( _cruxList.length, (int index) => Container( width: double.infinity, padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 8.w), margin: EdgeInsets.symmetric(vertical: 5.w), decoration: BoxDecoration( color: Colors.grey[100], borderRadius: BorderRadius.circular(20.r), border: Border.all( color: Colors.grey[300]!, ), ), child: Text( _cruxList[index], style: TextStyle(fontSize: 12.sp), ), ), ), ], ), ); } Widget _inputBox() { return Container( height: 40.w, padding: EdgeInsets.symmetric(horizontal: 10.w), decoration: BoxDecoration(), child: Row( children: [], ), ); } }