import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/palm/addPalm/addPalm_logic.dart'; import 'package:star_lock/main/lockDetail/palm/addPalm/addPalm_state.dart'; import '../../../../../app_settings/app_colors.dart'; import '../../../../../tools/submitBtn.dart'; import '../../../../../tools/titleAppBar.dart'; class AddPalmPage extends StatefulWidget { const AddPalmPage({Key? key}) : super(key: key); @override State createState() => _AddPalmPageState(); } class _AddPalmPageState extends State { final AddPalmLogic logic = Get.put(AddPalmLogic()); final AddPalmState state = Get.find().state; @override Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, appBar: TitleAppBar( barTitle: '添加手掌', haveBack: true, backgroundColor: AppColors.mainColor), body: ListView( children: [ SizedBox( height: 50.h, ), Obx(() => Image.asset( state.isClickAddPalm.value == false ? 'images/main/icon_addPalm_step1.png' : 'images/main/icon_addPalm_step1.png', width: 100.w, height: 457.h, fit: BoxFit.fitHeight, )), SizedBox( height: 60.h, ), Container( padding: EdgeInsets.only(left: 20.w, right: 20.w), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( child: Text( '请自然张开手掌,掌心正对摄像头,距离约一个成年\n人手掌宽度(约10厘米)。', textAlign: TextAlign.left, maxLines: null, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600), ), ), ], ), ), SizedBox( height: 120.h, ), Obx(() => // state.isClickAddPalm.value == false // ? GestureDetector( // onTap: () { // logic.senderAddPalm(); // }, // child: Container( // width: 1.sw, // padding: EdgeInsets.all(10.w), // margin: EdgeInsets.only(left: 15.w, right: 15.w, top: 10.h, bottom: 10.h), // decoration: BoxDecoration( // color: AppColors.mainColor, // borderRadius: BorderRadius.circular(10.w), // ), // child: Center(child: Text('准备好了,开始添加', style: TextStyle(color: Colors.white, fontSize: 24.sp)))), // ) // : Container( width: 1.sw, padding: EdgeInsets.all(10.w), margin: EdgeInsets.only(left: 15.w, right: 15.w, top: 10.h, bottom: 10.h), decoration: BoxDecoration( color: AppColors.mainColor, borderRadius: BorderRadius.circular(10.w), ), child: Center( child: Text( state.ifConnectScuess.value ? '已连接到锁,请自然张开手掌,掌心正对摄像头' : '尝试连接设备...', style: TextStyle(color: Colors.white, fontSize: 24.sp))), ) ) ], ), ); } }