爆肝研发Flutter3.41+DeepSeek+Window_manager实战桌面客户端AI对话系统
2026实战跨平台flutter3.41+deepseek+getx+dio电脑端智能AI系统。
flutter3-win-ai:基于
Flutter3.41.5+Dart3.11+Dio+window_manager调用DeepSeek聊天大模型搭建桌面端ai对话助手。支持各种代码高亮/复制代码、深度思考、latex公式、mermaid渲染、图片预览/链接跳转/表格展示等功能。



使用技术
- 编辑器:vscode
- 跨平台技术框架:flutter3.41.5+dart3.11.3
- 大模型框架:deepseek-v3.2
- 流式请求:dio^5.9.2
- 路由/状态管理:get^4.7.3
- 本地存储:get_storage^2.1.1
- markdown解析:flutter_markdown_plus^1.0.7
- latex公式:flutter_markdown_plus_latex^1.0.5
- 窗口管理:window_manager^0.5.1
- 托盘管理:system_tray^2.0.3


项目框架结构
基于最新跨平台框架flutter3.41.5创建项目,集成deepseek对话模型。
flutter3-deepseek-winai已经正式更新到我的原创作品集,欢迎下载使用。

flutter配置项目环境变量

# 项目名称
APP_NAME = 'Flutter3-WinSeek'
# DeepSeek API配置
DEEPSEEK_API_KEY = apikey
DEEPSEEK_BASE_URL = https://api.deepseek.com
获取.env环境变量
// 获取.env环境变量baseUrl和apiKey
String baseURL = dotenv.get('DEEPSEEK_BASE_URL');
String apiKEY = dotenv.get('DEEPSEEK_API_KEY');







项目公共布局模板


return Scaffold(
backgroundColor: Colors.grey[50],
body: DragToResizeArea(
child: Row(
children: [
// 侧边栏
AnimatedSize(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
child: Container(
width: collapsed ? 0 : 260,
decoration: BoxDecoration(
border: Border(right: BorderSide(color: Colors.grey.withAlpha(50)))
),
child: Material(
color: Color(0xFFF3F3F3),
child: Sidebar(),
),
),
),
// 主体容器
Expanded(
child: Column(
children: [
// 自定义导航栏
SizedBox(
height: 30.0,
child: Row(
children: [
IconButton(
onPressed: () {
setState(() {
collapsed = !collapsed;
});
},
icon: Icon(collapsed ? Icons.format_indent_increase : Icons.format_indent_decrease, size: 16.0,),
tooltip: collapsed ? '展开' : '收缩',
),
Expanded(
child: DragToMoveArea(
child: SizedBox(
height: double.infinity,
),
),
),
// 右上角操作按钮
WinBtns(
leading: Row(
children: [
...
],
),
),
],
),
),
// 右侧主面板
Expanded(
child: Container(
child: widget.child,
),
),
],
),
),
],
),
),
);







flutter3自定义ai对话框



return Container(
width: double.infinity,
padding: EdgeInsets.symmetric(vertical: 10.0),
child: Column(
spacing: 6.0,
children: [
// 技能栏
if (widget.skillbar)
ScrollConfiguration(
behavior: CustomScrollBehavior(),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
padding: EdgeInsets.symmetric(horizontal: 15.0),
child: Row(
spacing: 4.0,
children: [
...
]
),
),
),
// 编辑框
Container(
margin: EdgeInsets.symmetric(horizontal: 15.0),
padding: EdgeInsets.all(10.0),
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: Colors.grey.withAlpha(100), width: .5),
borderRadius: BorderRadius.circular(15.0),
boxShadow: [
BoxShadow(
color: Colors.black.withAlpha(20),
offset: Offset(0.0, 3.0),
blurRadius: 6.0,
spreadRadius: 0.0,
),
]
),
child: Column(
spacing: 10.0,
children: [
// 输入框
ConstrainedBox(
constraints: BoxConstraints(minHeight: 48.0, maxHeight: 150.0),
child: TextField(
...
),
),
// 操作栏
Row(
spacing: 10.0,
children: [
SizedBox(
height: 30.0,
child: TextButton(
onPressed: () {
// ...
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(isDeep ? Color(0xFF4F6BFE).withAlpha(30) : Colors.grey[200]),
padding: WidgetStateProperty.all(EdgeInsets.symmetric(horizontal: 10.0)),
),
child: Row(
spacing: 4.0,
children: [
Icon(Icons.stream, color: isDeep ? Color(0xFF4F6BFE) : Colors.black, size: 18.0,),
Text('深度思考(R1)', style: TextStyle(color: isDeep ? Color(0xFF4F6BFE) : Colors.black, fontSize: 13.0),),
],
),
),
),
SizedBox(
height: 30.0,
child: TextButton(
onPressed: () {
// ...
},
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(isNetwork ? Color(0xFF4F6BFE).withAlpha(30) : Colors.grey[200]),
padding: WidgetStateProperty.all(EdgeInsets.symmetric(horizontal: 10.0)),
),
child: Row(
spacing: 4.0,
children: [
Icon(Icons.travel_explore, color: isNetwork ? Color(0xFF4F6BFE) : Colors.black, size: 18.0,),
Text('联网', style: TextStyle(color: isNetwork ? Color(0xFF4F6BFE) : Colors.black, fontSize: 13.0),),
],
),
),
),
Spacer(),
SizedBox(
height: 30.0,
width: 30.0,
child: IconButton(
...
),
),
SizedBox(
height: 30.0,
width: 30.0,
child: IconButton(
...
),
)
],
),
],
),
),
],
)
);



flutter3+deepseek流式打字输出
// 调用deepseek接口
final response = await dio.post(
'$baseURL/v1/chat/completions',
options: Options(
// 响应超时
receiveTimeout: const Duration(seconds: 60),
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer $apiKEY",
},
// 设置响应类型为流式响应
responseType: ResponseType.stream,
),
data: {
// 多轮会话
'messages': widget.multiConversation ? chatStore.historySession : [{'role': 'user', 'content': editorValue}],
// deepseek-chat对话模型 deepseek-reasoner推理模型
'model': chatStore.getSetting('thinkingEnabled') ? 'deepseek-reasoner' : 'deepseek-chat',
'stream': true, // 流式输出
'max_tokens': 8192, // 限制一次请求中模型生成 completion 的最大 token 数(默认使用 4096)
'temperature': 0.4, // 严谨采样 越低越严谨(默认1)
}
);

往期推荐
2026研发flutter3.41+dart3.11+getx+dio仿写deepseek app智能流式ai应用
vite8.0+vue3+deepseek+arcoDesign搭建网页版webai流式打字模板
首发Electron41+Vite8.0+Vue3+DeepSeek打造桌面版AI流式输出Exe
2026升级款vite8.0+vue3.5+deepseek移动端h5智能ai模板
2026開年重磅uni-app+mphtml+deepseek安卓+小程序+H5流式ai
2026爆肝Tauri2.10+Vite7.3+Vue3+DeepSeek桌面客户端AI智能对话系统Exe
vite8.0+deepseek流式ai模板|vue3.5+vant4+markdown打字输出ai助手
flutter3.38手搓抖音app系统|flutter3.38+dart3.10+getx+mediakit短视频+聊天+直播
Electron38-Vue3Chat电脑端聊天|vite7+electron38+pinia3仿微信Exe聊天系统
最新研发Tauri2.9+Vite7.2+Vue3 setup+ArcoDesign+Echarts客户端OS系统
最新款Electron38+Vue3+Vite7+ElementPlus客户端admin管理系统
vite7-vue3-webos网页版仿macos系统|Vite7+Pinia3+Arco网页版os系统
基于flutter3.32+window_manager+get仿macOS/wins桌面os系统
基于uni-app+vue3+pinia2+uv-ui仿抖音app短视频+聊天+直播应用
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐
所有评论(0)