import 'package:ef/ef.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:flutterflow_ui/flutterflow_ui.dart'; import 'package:vbvs_app/common/color/appConstants.dart'; import 'package:vbvs_app/common/color/app_uri_status.dart'; import 'package:vbvs_app/common/util/FitTool.dart'; import 'package:vbvs_app/common/util/MyUtils.dart'; import 'package:vbvs_app/component/tool/ClickableContainer.dart'; import 'package:vbvs_app/component/tool/CustomCard.dart'; import 'package:vbvs_app/component/tool/TopSlideNotification.dart'; import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart'; import 'package:vbvs_app/controller/main_bottom/global_controller.dart'; import 'package:vbvs_app/controller/setting/language/language_controller.dart'; import 'package:vbvs_app/controller/theme_controller/ThemeController.dart'; import 'package:vbvs_app/controller/user_info_controller.dart'; import 'package:vbvs_app/model/api_response.dart'; class SettingPage extends StatefulWidget { const SettingPage({super.key}); @override State createState() => _SettingPageState(); } class _SettingPageState extends State { GlobalController globalController = Get.find(); UserInfoController userInfoController = Get.find(); BlueteethBindController blueteethBindController = Get.find(); ThemeController themeController = Get.find(); LanguageController languageController = Get.find(); @override void initState() { languageController.initLanuageList(); super.initState(); } @override Widget build(BuildContext context) { return LayoutBuilder( builder: (context, bodySize) => GestureDetector( onTap: () => FocusScope.of(context).unfocus(), child: Container( decoration: BoxDecoration( image: DecorationImage( image: AssetImage('assets/img/bgNoImg.png'), // 本地图片 fit: BoxFit.fill, // 填满整个 Container ), ), child: Scaffold( backgroundColor: Colors.transparent, // 加上这一行 appBar: AppBar( backgroundColor: themeController.currentColor.sc17, automaticallyImplyLeading: false, iconTheme: IconThemeData( color: themeController.currentColor.sc3, ), titleSpacing: 0.rpx, // leading: returnIconButtom, title: Container( width: double.infinity, height: 180.rpx, child: Stack( alignment: Alignment.center, children: [ /// 居中标题 Text( '设置页.标题'.tr, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Readex Pro', color: themeController.currentColor.sc3, letterSpacing: 0, fontSize: 30.rpx, ), ), /// 左边返回按钮 Positioned( left: 0, child: returnIconButtom, ), ], ), ), actions: [], centerTitle: false, ), body: SafeArea( top: true, child: Padding( padding: EdgeInsetsDirectional.fromSTEB(30.rpx, 0, 30.rpx, 0), child: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, children: [ Padding( padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 25.rpx, 0.rpx, 0), child: Container( width: double.infinity, decoration: BoxDecoration( color: Color(0xFF242835), borderRadius: BorderRadius.circular( AppConstants().normal_container_radius), ), child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 0, 0.rpx, 0), child: Column( mainAxisSize: MainAxisSize.max, children: [ ClickableContainer( backgroundColor: Colors.transparent, // 容器背景色 highlightColor: themeController .currentColor.sc21, // 点击时的背景色 padding: EdgeInsetsDirectional.fromSTEB( 40.rpx, 0.rpx, 40.rpx, 0.rpx), onTap: () { TopSlideNotification.show(context, text: "待开发功能".tr); }, child: Container( child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 30.rpx, 0.rpx, 30.rpx), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( mainAxisSize: MainAxisSize.max, children: [ Text( '设置页.主题模式'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: 'Inter', color: themeController .currentColor.sc3, fontSize: AppConstants() .title_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox(width: 22.rpx)), ), Row( mainAxisSize: MainAxisSize.max, children: [ Text( '深色', style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: 'Inter', color: Color(0xFFD9E3EB), fontSize: 26.rpx, letterSpacing: 0.0, ), ), SvgPicture.asset( 'assets/img/icon/arrow_right.svg', width: 8.rpx, height: 15 .rpx, // 如果 SVG 中没有固定颜色,可以这样设置 color: themeController .currentColor.sc3, ), ].divide(SizedBox(width: 28.rpx)), ), ], ), ), ), ), ClickableContainer( backgroundColor: Colors.transparent, // 容器背景色 highlightColor: themeController .currentColor.sc21, // 点击时的背景色 padding: EdgeInsetsDirectional.fromSTEB( 40.rpx, 0.rpx, 40.rpx, 0.rpx), onTap: () { // TopSlideNotification.show(context, // text: "待开发功能".tr); Get.toNamed("/languageSetting"); }, child: Container( child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 30.rpx, 0.rpx, 30.rpx), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( mainAxisSize: MainAxisSize.max, children: [ Text( '设置页.选择语言'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: 'Inter', color: themeController .currentColor.sc3, fontSize: AppConstants() .title_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox(width: 22.rpx)), ), Row( mainAxisSize: MainAxisSize.max, children: [ Obx(() { return Text( languageController .selectLanguage .value! .language_name!, style: FlutterFlowTheme.of( context) .bodyMedium .override( fontFamily: 'Inter', color: Color(0xFFD9E3EB), fontSize: 26.rpx, letterSpacing: 0.0, ), ); }), SvgPicture.asset( 'assets/img/icon/arrow_right.svg', width: 8.rpx, height: 15 .rpx, // 如果 SVG 中没有固定颜色,可以这样设置 color: themeController .currentColor.sc3, ), ].divide(SizedBox(width: 28.rpx)), ), ], ), ), ), ), ClickableContainer( backgroundColor: Colors.transparent, // 容器背景色 highlightColor: themeController .currentColor.sc21, // 点击时的背景色 padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 0.rpx, 0.rpx, 0.rpx), onTap: () { print('点击了容器'); Get.toNamed("/aboutUsPage"); }, child: Container( child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 40.rpx, 30.rpx, 40.rpx, 30.rpx), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( mainAxisSize: MainAxisSize.max, children: [ Text( '设置页.关于我们'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: 'Inter', color: themeController .currentColor.sc3, fontSize: AppConstants() .title_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox(width: 22.rpx)), ), SvgPicture.asset( 'assets/img/icon/arrow_right.svg', width: 8.rpx, height: 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 color: themeController .currentColor.sc3, ), ], ), ), ), ), ClickableContainer( backgroundColor: Colors.transparent, // 容器背景色 highlightColor: themeController .currentColor.sc21, // 点击时的背景色 padding: EdgeInsetsDirectional.fromSTEB( 40.rpx, 0.rpx, 40.rpx, 0.rpx), onTap: () { // TopSlideNotification.show(context, // text: "待开发功能".tr); Get.toNamed("/userSchemePage"); }, child: Container( child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 30.rpx, 0.rpx, 30.rpx), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( mainAxisSize: MainAxisSize.max, children: [ Text( '设置页.用户协议'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: 'Inter', color: themeController .currentColor.sc3, fontSize: AppConstants() .title_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox(width: 22.rpx)), ), SvgPicture.asset( 'assets/img/icon/arrow_right.svg', width: 8.rpx, height: 15.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 color: themeController .currentColor.sc3, ), ], ), ), ), ), ClickableContainer( backgroundColor: Colors.transparent, // 容器背景色 highlightColor: themeController .currentColor.sc21, // 点击时的背景色 padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 0.rpx, 0.rpx, 0.rpx), onTap: () { // TopSlideNotification.show(context, // text: "待开发功能".tr); Get.toNamed("/privacyPage"); }, child: Container( child: Padding( padding: EdgeInsetsDirectional.fromSTEB( 40.rpx, 30.rpx, 40.rpx, 30.rpx), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( mainAxisSize: MainAxisSize.max, children: [ Text( '设置页.隐私协议'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( fontFamily: 'Inter', color: themeController .currentColor.sc3, fontSize: AppConstants() .title_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox(width: 22.rpx)), ), SvgPicture.asset( 'assets/img/icon/arrow_right.svg', width: 8.rpx, height: 14.rpx, // 如果 SVG 中没有固定颜色,可以这样设置 color: themeController .currentColor.sc3, ), ], ), ), ), ), ] .divide(SizedBox(height: 0.rpx)) .addToStart(SizedBox(height: 30.rpx)) .addToEnd(SizedBox(height: 30.rpx)), ), ), ), ), Padding( padding: EdgeInsetsDirectional.fromSTEB( 100.rpx, 360.rpx, 100.rpx, 0), child: CustomCard( borderRadius: AppConstants().button_container_radius, // 圆角半径 onTap: () { ApiResponse apiResponse = userInfoController.logOut(); TopSlideNotification.show( context, text: apiResponse.msg!, textColor: apiResponse.code == HttpStatusCodes.ok ? themeController.currentColor.sc2 : themeController.currentColor.sc9, ); if (apiResponse.code == HttpStatusCodes.ok) { Get.offAllNamed("/mianPageBottomChange"); } }, colors: [ themeController.currentColor.sc9, ], // 渐变色是同一个色,也可以根据需要调整 child: Container( width: // MediaQuery.sizeOf(context).width * 0.66, bodySize.maxWidth, height: MediaQuery.sizeOf(context).height * 0.055, constraints: BoxConstraints( minWidth: 500.rpx, minHeight: 90.rpx, ), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ Text( '设置页.退出登录'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( color: themeController.currentColor.sc3, fontFamily: 'Inter', fontSize: AppConstants().normal_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox( width: 17.rpx, )), ), ), ), ), Padding( padding: EdgeInsetsDirectional.fromSTEB( 100.rpx, 20.rpx, 100.rpx, 0), child: CustomCard( borderRadius: AppConstants().button_container_radius, // 圆角半径 onTap: () { TopSlideNotification.show( context, text: "待开发功能".tr, ); }, colors: [ Colors.transparent, ], // 渐变色是同一个色,也可以根据需要调整 child: Container( width: // MediaQuery.sizeOf(context).width * 0.66, bodySize.maxWidth, height: MediaQuery.sizeOf(context).height * 0.055, constraints: BoxConstraints( minWidth: 500.rpx, minHeight: 90.rpx, ), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ Text( '设置页.注销账号'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( color: themeController.currentColor.sc9, fontFamily: 'Inter', fontSize: AppConstants().normal_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox( width: 17.rpx, )), ), ), ), ), Padding( padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 100.rpx, 0.rpx, 0), child: ClickableContainer( borderRadius: AppConstants().button_container_radius, // 圆角半径 onTap: () {}, backgroundColor: Colors.transparent, // 渐变色是同一个色,也可以根据需要调整 highlightColor: themeController.currentColor.sc5, padding: EdgeInsetsDirectional.fromSTEB( 0.rpx, 0.rpx, 0.rpx, 0), child: Container( width: // MediaQuery.sizeOf(context).width * 0.66, bodySize.maxWidth, height: MediaQuery.sizeOf(context).height * 0.055, constraints: BoxConstraints( minWidth: 500.rpx, minHeight: 90.rpx, ), child: Column( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [ Text( 'ICP备案号:浙ICP备2023000785号-1'.tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( color: themeController.currentColor.sc4, fontFamily: 'Inter', fontSize: AppConstants() .smaller_text_fontSize, letterSpacing: 0.0, ), ), Text( 'Copyright © 202-2025 嘉兴太和信息技术有限责任公司 版权所有' .tr, style: FlutterFlowTheme.of(context) .bodyMedium .override( color: themeController.currentColor.sc4, fontFamily: 'Inter', fontSize: AppConstants() .smaller_text_fontSize, letterSpacing: 0.0, ), ), ].divide(SizedBox( height: 17.rpx, ))), ), ), ), ], ), ), ), ), ), ), ), ); } Widget _buildDeviceCard(BuildContext context, {required String title, required String imageUrl, required String type}) { return CustomCard( borderRadius: 20.rpx, // 圆角大小 onTap: () { if (type != null) { if (type == '1') { Get.toNamed("/blueteethDevice"); } } }, colors: [themeController.currentColor.sc17], // 背景色 child: Container( width: double.infinity, height: MediaQuery.sizeOf(context).height * 0.135, constraints: BoxConstraints( minHeight: 220.rpx, ), padding: EdgeInsetsDirectional.fromSTEB(77.rpx, 0, 21.rpx, 0), child: Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( title, style: FlutterFlowTheme.of(context).bodyMedium.override( fontFamily: 'Inter', color: const Color(0xFFC2CED7), fontSize: 30.rpx, letterSpacing: 0.0, ), ), ClipRRect( borderRadius: BorderRadius.circular(8.rpx), child: Image.asset( imageUrl, width: 212.rpx, height: 168.rpx, ), ), ], ), ), ); } }