diff --git a/star_lock/flavorizr.yaml b/star_lock/flavorizr.yaml index a4e6d12e..888c136f 100644 --- a/star_lock/flavorizr.yaml +++ b/star_lock/flavorizr.yaml @@ -43,6 +43,8 @@ # 下面是安卓发布编译命令 # flutter build apk --split-per-abi --release --flavor sky -t lib/main_sky.dart +# flutter build apk --release --flavor sky -t lib/main_sky.dart + # IOS编译发布 # TODO 待补充 diff --git a/star_lock/lib/login/selectCountryRegion/common/utils.dart b/star_lock/lib/login/selectCountryRegion/common/utils.dart index ec1dcf35..81c20761 100644 --- a/star_lock/lib/login/selectCountryRegion/common/utils.dart +++ b/star_lock/lib/login/selectCountryRegion/common/utils.dart @@ -43,7 +43,8 @@ class Utils { BuildContext context, CountryRegionModel model, Function() onClick, {double susHeight = 40}) { return GestureDetector( - child: SizedBox( + child: Container( + color: Colors.white, height: 80.h, child: Row( mainAxisAlignment: MainAxisAlignment.center, @@ -60,13 +61,13 @@ class Utils { child: SizedBox( width: 30.w, )), - Text( - '+${model.code}', - style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp), - ), - SizedBox( - width: 60.w, - ) + // Text( + // '+${model.code}', + // style: TextStyle(color: AppColors.blackColor, fontSize: 22.sp), + // ), + // SizedBox( + // width: 60.w, + // ) ], ), ), diff --git a/star_lock/lib/login/selectCountryRegion/selectCountryRegion_page.dart b/star_lock/lib/login/selectCountryRegion/selectCountryRegion_page.dart index b61ba36d..2c7e8995 100644 --- a/star_lock/lib/login/selectCountryRegion/selectCountryRegion_page.dart +++ b/star_lock/lib/login/selectCountryRegion/selectCountryRegion_page.dart @@ -22,14 +22,14 @@ class SelectCountryRegionPage extends StatefulWidget { class _SelectCountryRegionPageState extends State { List countriesList = []; + List topCountriesList = []; TextEditingController searchController = TextEditingController(); @override void initState() { super.initState(); - SuspensionUtil.setShowSuspensionStatus( - countriesList.cast()); + SuspensionUtil.setShowSuspensionStatus(countriesList.cast()); Future.delayed(const Duration(milliseconds: 20), () { getCountriesListRequest(); }); @@ -41,6 +41,12 @@ class _SelectCountryRegionPageState extends State { countriesList.clear(); if (entity.errorCode!.codeIsSuccessful) { countriesList.addAll(entity.dataList!); + for(CountryRegionModel model in countriesList){ + if(model.name! == "中国"){ + topCountriesList.add(model); + break; + } + } _handleList(countriesList); } } @@ -87,19 +93,40 @@ class _SelectCountryRegionPageState extends State { editingController: searchController, backgroundColor: AppColors.mainBackgroundColor, onSubmittedAction: () { - var searchList = []; - for (int i = 0, length = countriesList.length; i < length; i++) { - CountryRegionModel countryModel = countriesList[i]; - if(countryModel.name!.contains(searchController.text) || countryModel.code!.contains(searchController.text)){ - searchList.add(countryModel); - Get.log('countryModel.name:${countryModel.name} countryModel.code:${countryModel.code}'); + if(searchController.text.isEmpty){ + getCountriesListRequest(); + }else{ + var searchList = []; + for (int i = 0, length = countriesList.length; i < length; i++) { + CountryRegionModel countryModel = countriesList[i]; + if(countryModel.name!.contains(searchController.text) || countryModel.code!.contains(searchController.text)){ + searchList.add(countryModel); + Get.log('countryModel.name:${countryModel.name} countryModel.code:${countryModel.code}'); + } } + countriesList= searchList; + Get.log('searchList.length:${searchList.length}'); + _handleList(searchList); } - Get.log('searchList.length:${searchList.length}'); - _handleList(searchList); + setState(() {}); }, ), SizedBox(height:20.h), + Visibility( + visible: searchController.text.isEmpty, + child: Utils.getSusItem(context, '★') + ), + countriesList.isNotEmpty ? Visibility( + visible: searchController.text.isEmpty, + child: Utils.getListItem(context, topCountriesList[0], () { + CountryRegionModel model = topCountriesList[0]; + Map resultMap = {}; + resultMap['code'] = model.code ?? ''; + resultMap['countryId'] = model.countryId.toString() ?? ''; + resultMap['countryName'] = model.name ?? '' ; + Navigator.pop(context, resultMap); + }) + ): Container(), Expanded( child: AzListView( data: countriesList, @@ -111,6 +138,7 @@ class _SelectCountryRegionPageState extends State { resultMap['code'] = model.code; resultMap['countryId'] = model.countryId.toString(); resultMap['countryName'] = model.name; + print("model.name:${model.name} model.code:${model.code} model.countryId:${model.countryId} model.flag:${model.flag} model.group:${model.group} model.tagIndex:${model.tagIndex}"); Navigator.pop(context, resultMap); }); }, diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart index 288240e7..3f9fd145 100644 --- a/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart +++ b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_page.dart @@ -48,18 +48,20 @@ class _TransferSmartLockPageState extends State { TextButton( onPressed: () { setState(() { - for (var element in state.transferSmartLockListData.value) { - if(state.isSelectAll == true){ + if(state.isSelectAll == true){ + for (var element in state.transferSmartLockListData.value) { state.isSelectAll = false; element.select = 0; - }else{ + } + }else{ + for (var element in state.transferSmartLockListData.value) { state.isSelectAll = true; element.select = 1; } } }); }, - child: Text(state.isSelectAll == true ? TranslationLoader.lanKeys!.checkAll!.tr : TranslationLoader.lanKeys!.cancel!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp))) + child: Text(state.isSelectAll == true ? TranslationLoader.lanKeys!.cancel!.tr : TranslationLoader.lanKeys!.checkAll!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp))) ], ), body: EasyRefreshTool( diff --git a/star_lock/lib/versionUndate/versionUndateTool.dart b/star_lock/lib/versionUndate/versionUndateTool.dart index 671d4347..ef5224d4 100644 --- a/star_lock/lib/versionUndate/versionUndateTool.dart +++ b/star_lock/lib/versionUndate/versionUndateTool.dart @@ -1,3 +1,4 @@ + import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; @@ -9,7 +10,6 @@ import 'package:package_info_plus/package_info_plus.dart'; import 'package:url_launcher/url_launcher.dart'; import '../network/api_repository.dart'; -import '../tools/storage.dart'; import '../translations/trans_lib.dart'; import 'versionUndate_entity.dart';