fix: 增加ai助理、调整第三方协议
This commit is contained in:
parent
b5dfd10baa
commit
d3cd4adce8
BIN
images/other/2.png
Normal file
BIN
images/other/2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
BIN
images/other/ai.png
Normal file
BIN
images/other/ai.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
images/other/matter.png
Normal file
BIN
images/other/matter.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.0 KiB |
BIN
images/other/tuya.png
Normal file
BIN
images/other/tuya.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
@ -18,6 +18,7 @@ import 'package:star_lock/main/lockDetail/iris/addIris/addIris_page.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/iris/addIrisType/addIrisTypeManage/addIrisTypeManage_page.dart';
|
import 'package:star_lock/main/lockDetail/iris/addIrisType/addIrisTypeManage/addIrisTypeManage_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/iris/irisList/irisList_page.dart';
|
import 'package:star_lock/main/lockDetail/iris/irisList/irisList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
|
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/aiAssistant/ai_assistant_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeCustomMode/catEyeCustomMode_page.dart';
|
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeCustomMode/catEyeCustomMode_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_page.dart';
|
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/videoSlot/videoSlot_page.dart';
|
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/videoSlot/videoSlot_page.dart';
|
||||||
@ -532,6 +533,7 @@ abstract class Routers {
|
|||||||
static const String permissionGuidancePage =
|
static const String permissionGuidancePage =
|
||||||
'/permissionGuidancePage'; // 锁屏权限通知引导页面
|
'/permissionGuidancePage'; // 锁屏权限通知引导页面
|
||||||
static const String lockVoiceSettingPage = '/lockVoiceSetting'; // 锁屏权限通知引导页面
|
static const String lockVoiceSettingPage = '/lockVoiceSetting'; // 锁屏权限通知引导页面
|
||||||
|
static const String aiAssistant = '/aiAssistant';
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AppRouters {
|
abstract class AppRouters {
|
||||||
@ -1224,6 +1226,9 @@ abstract class AppRouters {
|
|||||||
GetPage<dynamic>(
|
GetPage<dynamic>(
|
||||||
name: Routers.thirdPartyPlatformPage,
|
name: Routers.thirdPartyPlatformPage,
|
||||||
page: () => ThirdPartyPlatformPage()),
|
page: () => ThirdPartyPlatformPage()),
|
||||||
|
GetPage<dynamic>(
|
||||||
|
name: Routers.aiAssistant,
|
||||||
|
page: () => AiAssistantPage()),
|
||||||
// 插件播放页面
|
// 插件播放页面
|
||||||
// GetPage<dynamic>(name: Routers.h264View, page: () => H264WebView()), // webview播放页面
|
// GetPage<dynamic>(name: Routers.h264View, page: () => H264WebView()), // webview播放页面
|
||||||
];
|
];
|
||||||
|
|||||||
@ -27,6 +27,11 @@ class EventSendModel {
|
|||||||
Uuid? serviceId;
|
Uuid? serviceId;
|
||||||
Uuid? characteristicId;
|
Uuid? characteristicId;
|
||||||
bool? allowLongWrite = false;
|
bool? allowLongWrite = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'EventSendModel{data: $data, topic: $topic, sendChannel: $sendChannel, deviceId: $deviceId, serviceId: $serviceId, characteristicId: $characteristicId, allowLongWrite: $allowLongWrite}';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///接收数据类
|
///接收数据类
|
||||||
|
|||||||
@ -0,0 +1,7 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lockSet/aiAssistant/ai_assistant_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class AiAssistantLogic extends BaseGetXController{
|
||||||
|
final AiAssistantState state = AiAssistantState();
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/aiAssistant/ai_assistant_logic.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/aiAssistant/ai_assistant_state.dart';
|
||||||
|
import 'package:star_lock/tools/commonItem.dart';
|
||||||
|
import 'package:star_lock/tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class AiAssistantPage extends StatefulWidget {
|
||||||
|
const AiAssistantPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AiAssistantPage> createState() => _AiAssistantPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AiAssistantPageState extends State<AiAssistantPage> {
|
||||||
|
final AiAssistantLogic logic = Get.put(AiAssistantLogic());
|
||||||
|
final AiAssistantState state = Get.find<AiAssistantLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: TitleAppBar(barTitle: 'AI助理设置'.tr, haveBack: true, backgroundColor: AppColors.mainColor),
|
||||||
|
body: Container(
|
||||||
|
width: 1.sw,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20.w),
|
||||||
|
margin: EdgeInsets.only(top: 20.h),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'images/other/ai.png',
|
||||||
|
height: 250.h,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'AI助理的支持依赖网络授权下载,打开功能开关时请保证手机数据网络的正常连接'.tr,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 50.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: 'Ai语音菜单'.tr,
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
// 最后一个元素不显示分割线(取反)
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: CupertinoSwitch(
|
||||||
|
value: false,
|
||||||
|
onChanged: (value) {},
|
||||||
|
),
|
||||||
|
action: () {
|
||||||
|
logic.showToast('功能待开放'.tr);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: 'Ai智能语音交互'.tr,
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: false,
|
||||||
|
// 最后一个元素不显示分割线(取反)
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: CupertinoSwitch(
|
||||||
|
value: false,
|
||||||
|
onChanged: (value) {},
|
||||||
|
),
|
||||||
|
action: () {
|
||||||
|
logic.showToast('功能待开放'.tr);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,12 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
|
class AiAssistantState {
|
||||||
|
AiAssistantState() {
|
||||||
|
final map = Get.arguments;
|
||||||
|
lockSetInfoData.value = map['lockSetInfoData'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Rx<LockSetInfoData> lockSetInfoData = LockSetInfoData().obs;
|
||||||
|
|
||||||
|
}
|
||||||
@ -553,6 +553,19 @@ class _LockSetPageState extends State<LockSetPage>
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
// 锁语音包设置
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: 'AI助理'.tr,
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.aiAssistant,
|
||||||
|
arguments: <String, LockSetInfoData>{
|
||||||
|
'lockSetInfoData': state.lockSetInfoData.value
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
// 蓝牙广播(关闭则不能使用蓝牙主动开锁)
|
// 蓝牙广播(关闭则不能使用蓝牙主动开锁)
|
||||||
/* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu
|
/* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
|
|||||||
@ -17,8 +17,7 @@ class ThirdPartyPlatformPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
|
class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
|
||||||
final ThirdPartyPlatformLogic logic = Get.put(ThirdPartyPlatformLogic());
|
final ThirdPartyPlatformLogic logic = Get.put(ThirdPartyPlatformLogic());
|
||||||
final ThirdPartyPlatformState state =
|
final ThirdPartyPlatformState state = Get.find<ThirdPartyPlatformLogic>().state;
|
||||||
Get.find<ThirdPartyPlatformLogic>().state;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -46,52 +45,107 @@ class _ThirdPartyPlatformPageState extends State<ThirdPartyPlatformPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildBody() {
|
Widget _buildBody() {
|
||||||
return ListView.builder(
|
return Stack(
|
||||||
itemCount: state.platFormSet.length,
|
children: [
|
||||||
itemBuilder: (BuildContext context, int index) {
|
// 1. 背景或空白区域(可选)
|
||||||
// 判断是否是最后一个元素(索引等于 itemCount - 1)
|
Container(
|
||||||
final isLastItem = index == state.platFormSet.length - 1;
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.all(16.w),
|
||||||
|
),
|
||||||
|
// 2. 顶部图标行:使用 Row 并排显示
|
||||||
|
Positioned(
|
||||||
|
top: 80.h,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly, // 均匀分布
|
||||||
|
children: [
|
||||||
|
Image.asset(
|
||||||
|
'images/other/tuya.png',
|
||||||
|
height: 50.h,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/other/2.png', // 中间图标
|
||||||
|
height: 80.h,
|
||||||
|
|
||||||
// 获取当前平台数据(假设 platFormSet 是 RxList<Platform>)
|
fit: BoxFit.cover,
|
||||||
final platform = state.platFormSet.value[index];
|
),
|
||||||
return CommonItem(
|
Image.asset(
|
||||||
leftTitel: state.platFormSet.value[index],
|
'images/other/matter.png',
|
||||||
rightTitle: '',
|
width: 110.w,
|
||||||
isHaveLine: !isLastItem,
|
fit: BoxFit.cover,
|
||||||
// 最后一个元素不显示分割线(取反)
|
),
|
||||||
isHaveDirection: false,
|
],
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: Radio<String>(
|
|
||||||
// Radio 的值:使用平台的唯一标识(如 id)
|
|
||||||
value: platform,
|
|
||||||
// 当前选中的值:与 selectPlatFormIndex 关联的 id
|
|
||||||
groupValue:
|
|
||||||
state.platFormSet.value[state.selectPlatFormIndex.value],
|
|
||||||
// 选中颜色(可选,默认主题色)
|
|
||||||
activeColor: AppColors.mainColor,
|
|
||||||
// 点击 Radio 时回调(更新选中索引)
|
|
||||||
onChanged: (value) {
|
|
||||||
if (value != null) {
|
|
||||||
setState(() {
|
|
||||||
// 找到当前选中平台的索引(根据 id 匹配)
|
|
||||||
final newIndex =
|
|
||||||
state.platFormSet.value.indexWhere((p) => p == value);
|
|
||||||
if (newIndex != -1) {
|
|
||||||
state.selectPlatFormIndex.value = newIndex;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
action: () {
|
),
|
||||||
setState(() {
|
Positioned(
|
||||||
state.selectPlatFormIndex.value = index;
|
top: 220.h,
|
||||||
});
|
left: 20.w,
|
||||||
},
|
right: 20.w,
|
||||||
);
|
child: Text(
|
||||||
},
|
'第三方协议的支持依赖网络授权下载,打开功能开关时请保证手机数据网络的正常连接'.tr,
|
||||||
shrinkWrap: true,
|
textAlign: TextAlign.center,
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
style: TextStyle(
|
||||||
|
fontSize: 20.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Positioned(
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
top: 320.h,
|
||||||
|
bottom: 0,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: state.platFormSet.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
// 判断是否是最后一个元素(索引等于 itemCount - 1)
|
||||||
|
final isLastItem = index == state.platFormSet.length - 1;
|
||||||
|
|
||||||
|
// 获取当前平台数据(假设 platFormSet 是 RxList<Platform>)
|
||||||
|
final platform = state.platFormSet.value[index];
|
||||||
|
return CommonItem(
|
||||||
|
leftTitel: state.platFormSet.value[index],
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: !isLastItem,
|
||||||
|
// 最后一个元素不显示分割线(取反)
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: Radio<String>(
|
||||||
|
// Radio 的值:使用平台的唯一标识(如 id)
|
||||||
|
value: platform,
|
||||||
|
// 当前选中的值:与 selectPlatFormIndex 关联的 id
|
||||||
|
groupValue: state.platFormSet.value[state.selectPlatFormIndex.value],
|
||||||
|
// 选中颜色(可选,默认主题色)
|
||||||
|
activeColor: AppColors.mainColor,
|
||||||
|
// 点击 Radio 时回调(更新选中索引)
|
||||||
|
onChanged: (value) {
|
||||||
|
if (value != null) {
|
||||||
|
setState(() {
|
||||||
|
// 找到当前选中平台的索引(根据 id 匹配)
|
||||||
|
final newIndex = state.platFormSet.value.indexWhere((p) => p == value);
|
||||||
|
if (newIndex != -1) {
|
||||||
|
state.selectPlatFormIndex.value = newIndex;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
action: () {
|
||||||
|
setState(() {
|
||||||
|
state.selectPlatFormIndex.value = index;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user