fix: 修复增值服务跳转Google Home报错问题
This commit is contained in:
parent
8715c4d7ee
commit
9ded5b34fc
@ -1,5 +1,6 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||||
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_state.dart';
|
import 'package:star_lock/mine/valueAddedServices/valueAddedServicesList/valueAddedServicesList_state.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
@ -23,6 +24,23 @@ class ValueAddedServicesListLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//用户信息
|
||||||
|
Future<void> userSettingsInfoRequest() async {
|
||||||
|
final UserSettingInfoEntity entity =
|
||||||
|
await ApiRepository.to.userSettingsInfo();
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
//是否打开Amazon Alexa
|
||||||
|
entity.data!.isAmazonAlexa! == 1
|
||||||
|
? state.isAmazonAlexa.value = true
|
||||||
|
: state.isAmazonAlexa.value = false;
|
||||||
|
|
||||||
|
//是否打开Google Home
|
||||||
|
entity.data!.isGoogleHome! == 1
|
||||||
|
? state.isGoogleHome.value = true
|
||||||
|
: state.isGoogleHome.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onReady() async {
|
Future<void> onReady() async {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|||||||
@ -116,7 +116,9 @@ class _ValueAddedServicesPageListState
|
|||||||
fontWeight: FontWeight.w600),
|
fontWeight: FontWeight.w600),
|
||||||
),
|
),
|
||||||
'Amazon Alexa', () {
|
'Amazon Alexa', () {
|
||||||
Get.toNamed(Routers.amazonAlexaPage);
|
Get.toNamed(Routers.amazonAlexaPage, arguments: <String, dynamic>{
|
||||||
|
'isAmazonAlexa': state.isAmazonAlexa.value
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
if (!F.isProductionEnv)
|
if (!F.isProductionEnv)
|
||||||
_valueAddedServicesItem(
|
_valueAddedServicesItem(
|
||||||
@ -129,7 +131,11 @@ class _ValueAddedServicesPageListState
|
|||||||
),
|
),
|
||||||
'Google Home', () {
|
'Google Home', () {
|
||||||
// EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds);
|
// EasyLoading.showToast('功能暂未开放', duration: 2000.milliseconds);
|
||||||
Get.toNamed(Routers.googleHomePage);
|
Get.toNamed(Routers.googleHomePage, arguments: <String, dynamic>{
|
||||||
|
'isGoogleHome': state.isGoogleHome.value
|
||||||
|
})?.then((Object? value) {
|
||||||
|
logic.userSettingsInfoRequest();
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
if (!F.isProductionEnv)
|
if (!F.isProductionEnv)
|
||||||
_valueAddedServicesItem(
|
_valueAddedServicesItem(
|
||||||
|
|||||||
@ -1 +1,6 @@
|
|||||||
class ValueAddedServicesListState {}
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class ValueAddedServicesListState {
|
||||||
|
RxBool isAmazonAlexa = false.obs; //亚马逊Alexa
|
||||||
|
RxBool isGoogleHome = false.obs; //谷歌Home
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user