feat: 星锁:猫眼设置页面—新增“呼叫目标”入口相关UI
This commit is contained in:
parent
db9e1d4e33
commit
8fe74cc22b
@ -0,0 +1,160 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/liveVideo/liveVideo_logic.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/liveVideo/liveVideo_state.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
|
||||
class LiveVideoPage extends StatefulWidget {
|
||||
const LiveVideoPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<LiveVideoPage> createState() => _LiveVideoPageState();
|
||||
}
|
||||
|
||||
class _LiveVideoPageState extends State<LiveVideoPage> {
|
||||
final LiveVideoLogic logic = Get.put(LiveVideoLogic());
|
||||
final LiveVideoState state = Get.find<LiveVideoLogic>().state;
|
||||
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
logic.getLockSettingInfoData();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '呼叫目标',
|
||||
haveBack: true,
|
||||
backAction: () {
|
||||
Navigator.pop(context, true);
|
||||
},
|
||||
backgroundColor: AppColors.mainColor,
|
||||
actionsList: <Widget>[
|
||||
TextButton(
|
||||
child: Text(
|
||||
'保存'.tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
state.isLiveView.value == false
|
||||
? state.realTimeMode.value = 0
|
||||
: state.realTimeMode.value = 1;
|
||||
|
||||
logic.updateCatEyeModeConfig();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Obx(() => Column(
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 80.h,
|
||||
),
|
||||
Image.asset(
|
||||
'images/lockSet_liveVideo.png',
|
||||
height: 541.h,
|
||||
width: 255.w,
|
||||
),
|
||||
SizedBox(
|
||||
height: 86.h,
|
||||
),
|
||||
_buildTipsView('管理员APP\n', '', 0),
|
||||
SizedBox(
|
||||
height: 16.h,
|
||||
),
|
||||
_buildTipsView('管理中心\n',
|
||||
'指定时问内,无论门锁是否发生安全事件或有人按门铃,都能在门锁首页随时查看实时画面;电池续航时问将会缩短。', 1),
|
||||
],
|
||||
)));
|
||||
}
|
||||
|
||||
Widget _buildTipsView(String titleStr, String subTitle, int clickIndex) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
width: ScreenUtil().screenWidth - 40.w,
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
|
||||
decoration: BoxDecoration(
|
||||
color: clickIndex == 0
|
||||
? (state.isLiveView.value == false
|
||||
? AppColors.blueViewBgColor
|
||||
: AppColors.greyBackgroundColor)
|
||||
: (state.isLiveView.value == true
|
||||
? AppColors.blueViewBgColor
|
||||
: AppColors.greyBackgroundColor),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
if (clickIndex == 0)
|
||||
state.isLiveView.value == false
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_blueSelect.png',
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
: SizedBox(
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
else
|
||||
state.isLiveView.value == true
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_blueSelect.png',
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
: SizedBox(
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
),
|
||||
SizedBox(width: 10.w),
|
||||
Expanded(
|
||||
child: _buildRichText(
|
||||
titleStr,
|
||||
subTitle,
|
||||
clickIndex == 0
|
||||
? (state.isLiveView.value == false ? true : false)
|
||||
: (state.isLiveView.value == true ? true : false)),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
onTap: () {
|
||||
if (clickIndex == 0) {
|
||||
state.isLiveView.value = false;
|
||||
} else {
|
||||
state.isLiveView.value = true;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRichText(String titleStr, String subTitle, bool isClick) {
|
||||
//高亮样式
|
||||
final TextStyle titleStyle = TextStyle(
|
||||
color: isClick ? AppColors.blueTextTipsColor : Colors.black,
|
||||
fontSize: 24.sp,
|
||||
fontWeight: FontWeight.w500);
|
||||
//默认样式
|
||||
final TextStyle subTipsStyle = TextStyle(
|
||||
color: isClick
|
||||
? AppColors.blueTextTipsColor
|
||||
: AppColors.placeholderTextColor,
|
||||
fontSize: 20.sp);
|
||||
|
||||
late InlineSpan tipsPreviewSpan = TextSpan(children: <InlineSpan>[
|
||||
TextSpan(text: titleStr, style: titleStyle),
|
||||
TextSpan(text: subTitle, style: subTipsStyle),
|
||||
]);
|
||||
return RichText(text: tipsPreviewSpan);
|
||||
}
|
||||
}
|
||||
@ -86,6 +86,14 @@ class _CatEyeSetPageState extends State<CatEyeSetPage> {
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: _otherToDoSwitch(3))),
|
||||
//ToDo 需增加国际化
|
||||
CommonItem(
|
||||
leftTitel: '呼叫目标'.tr,
|
||||
rightTitle: '管理员APP'.tr,
|
||||
allHeight: 70.h,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {}),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -96,27 +95,28 @@ class _LiveVideoPageState extends State<LiveVideoPage> {
|
||||
left: 20.w, top: 30.h, bottom: 30.h, right: 20.w),
|
||||
child: Row(
|
||||
children: <Widget>[
|
||||
clickIndex == 0
|
||||
? (state.isLiveView.value == false
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_blueSelect.png',
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
: SizedBox(
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
))
|
||||
: (state.isLiveView.value == true
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_blueSelect.png',
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
: SizedBox(
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)),
|
||||
if (clickIndex == 0)
|
||||
state.isLiveView.value == false
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_blueSelect.png',
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
: SizedBox(
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
else
|
||||
state.isLiveView.value == true
|
||||
? Image.asset(
|
||||
'images/mine/icon_mine_blueSelect.png',
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
)
|
||||
: SizedBox(
|
||||
width: 20.w,
|
||||
height: 14.w,
|
||||
),
|
||||
SizedBox(width: 10.w),
|
||||
Expanded(
|
||||
child: _buildRichText(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user