Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
This commit is contained in:
commit
bb725a7592
@ -1,4 +1,6 @@
|
|||||||
PODS:
|
PODS:
|
||||||
|
- aj_captcha_flutter (0.0.1):
|
||||||
|
- Flutter
|
||||||
- device_info_plus (0.0.1):
|
- device_info_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- Flutter (1.0.0)
|
- Flutter (1.0.0)
|
||||||
@ -16,11 +18,15 @@ PODS:
|
|||||||
- Flutter
|
- Flutter
|
||||||
- Protobuf (~> 3.5)
|
- Protobuf (~> 3.5)
|
||||||
- SwiftProtobuf (~> 1.0)
|
- SwiftProtobuf (~> 1.0)
|
||||||
|
- shared_preferences_foundation (0.0.1):
|
||||||
|
- Flutter
|
||||||
|
- FlutterMacOS
|
||||||
- SwiftProtobuf (1.22.0)
|
- SwiftProtobuf (1.22.0)
|
||||||
- url_launcher_ios (0.0.1):
|
- url_launcher_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
|
||||||
DEPENDENCIES:
|
DEPENDENCIES:
|
||||||
|
- aj_captcha_flutter (from `.symlinks/plugins/aj_captcha_flutter/ios`)
|
||||||
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
|
||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`)
|
- flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`)
|
||||||
@ -28,6 +34,7 @@ DEPENDENCIES:
|
|||||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`)
|
- reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`)
|
||||||
|
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
|
||||||
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
|
||||||
|
|
||||||
SPEC REPOS:
|
SPEC REPOS:
|
||||||
@ -36,6 +43,8 @@ SPEC REPOS:
|
|||||||
- SwiftProtobuf
|
- SwiftProtobuf
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
EXTERNAL SOURCES:
|
||||||
|
aj_captcha_flutter:
|
||||||
|
:path: ".symlinks/plugins/aj_captcha_flutter/ios"
|
||||||
device_info_plus:
|
device_info_plus:
|
||||||
:path: ".symlinks/plugins/device_info_plus/ios"
|
:path: ".symlinks/plugins/device_info_plus/ios"
|
||||||
Flutter:
|
Flutter:
|
||||||
@ -50,10 +59,13 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
:path: ".symlinks/plugins/path_provider_foundation/darwin"
|
||||||
reactive_ble_mobile:
|
reactive_ble_mobile:
|
||||||
:path: ".symlinks/plugins/reactive_ble_mobile/ios"
|
:path: ".symlinks/plugins/reactive_ble_mobile/ios"
|
||||||
|
shared_preferences_foundation:
|
||||||
|
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
|
||||||
url_launcher_ios:
|
url_launcher_ios:
|
||||||
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
:path: ".symlinks/plugins/url_launcher_ios/ios"
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
SPEC CHECKSUMS:
|
||||||
|
aj_captcha_flutter: dd7af1aa064bdd621ae335b819bab07309c3c023
|
||||||
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
|
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
|
||||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||||
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
||||||
@ -62,6 +74,7 @@ SPEC CHECKSUMS:
|
|||||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||||
Protobuf: c6bc59bbab3d38a71c67f62d7cb7ca8f8ea4eca1
|
Protobuf: c6bc59bbab3d38a71c67f62d7cb7ca8f8ea4eca1
|
||||||
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
|
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
|
||||||
|
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||||
SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989
|
SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989
|
||||||
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/ownedKeyList_page.dart';
|
|
||||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet_page.dart';
|
import 'package:star_lock/mine/mineSet/mineSet_page.dart';
|
||||||
@ -10,6 +10,7 @@ import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation_pa
|
|||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLock_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLock_page.dart';
|
||||||
|
|
||||||
|
import 'common/safetyVerification_page.dart';
|
||||||
import 'login/forgetPassword/starLock_forgetPassword_page.dart';
|
import 'login/forgetPassword/starLock_forgetPassword_page.dart';
|
||||||
import 'login/login/starLock_login_page.dart';
|
import 'login/login/starLock_login_page.dart';
|
||||||
import 'login/register/starLock_register_page.dart';
|
import 'login/register/starLock_register_page.dart';
|
||||||
@ -95,6 +96,7 @@ import 'mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetwor
|
|||||||
import 'mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart';
|
import 'mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart';
|
||||||
import 'mine/mineSet/lockGroup/lockItemList_page.dart';
|
import 'mine/mineSet/lockGroup/lockItemList_page.dart';
|
||||||
import 'mine/mineSet/lockScreen/lockScreen_page.dart';
|
import 'mine/mineSet/lockScreen/lockScreen_page.dart';
|
||||||
|
import 'mine/mineSet/lockUserManage/ownedKeyList_page.dart';
|
||||||
import 'mine/mine_page.dart';
|
import 'mine/mine_page.dart';
|
||||||
import 'mine/supportStaff/supportStaff_page.dart';
|
import 'mine/supportStaff/supportStaff_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesBuy/valueAddedServicesBuy_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesBuy/valueAddedServicesBuy_page.dart';
|
||||||
@ -239,33 +241,28 @@ abstract class Routers {
|
|||||||
'/ValueAddedServicesListEmailTemplatePage'; // 增值服务-邮箱模版列表
|
'/ValueAddedServicesListEmailTemplatePage'; // 增值服务-邮箱模版列表
|
||||||
static const valueAddedServicesAddEmailTemplatePage =
|
static const valueAddedServicesAddEmailTemplatePage =
|
||||||
'/ValueAddedServicesAddEmailTemplatePage'; // 增值服务-自定义邮箱模版
|
'/ValueAddedServicesAddEmailTemplatePage'; // 增值服务-自定义邮箱模版
|
||||||
static const valueAddedServicesBuyAndUseRecordManagePage =
|
static const valueAddedServicesBuyAndUseRecordManagePage = '/ValueAddedServicesBuyAndUseRecordManagePage'; // 增值服务-购买使用记录
|
||||||
'/ValueAddedServicesBuyAndUseRecordManagePage'; // 增值服务-购买使用记录
|
|
||||||
|
|
||||||
static const lockScreenPage = '/LockScreenPage'; // 我的设置-锁屏
|
static const lockScreenPage = '/LockScreenPage'; // 我的设置-锁屏
|
||||||
static const aPPUnlockNeedMobileNetworkingLockPage =
|
static const aPPUnlockNeedMobileNetworkingLockPage = '/APPUnlockNeedMobileNetworkingLockPage'; // 我的设置-app开锁时需手机连网的锁
|
||||||
'/APPUnlockNeedMobileNetworkingLockPage'; // 我的设置-app开锁时需手机连网的锁
|
static const hideInvalidUnlockPermissionsPage = '/HideInvalidUnlockPermissionsPage'; // 我的设置-隐藏无效开锁权限
|
||||||
static const hideInvalidUnlockPermissionsPage =
|
|
||||||
'/HideInvalidUnlockPermissionsPage'; // 我的设置-隐藏无效开锁权限
|
|
||||||
|
|
||||||
static const lockUserManageLisPage = '/LockUserManageLisPage'; //我的设置-锁用户管理
|
static const lockUserManageLisPage = '/LockUserManageLisPage'; //我的设置-锁用户管理
|
||||||
static const authorizedAdministratorListPage =
|
static const authorizedAdministratorListPage = '/AuthorizedAdministratorListPage'; //我的设置-授权管理员
|
||||||
'/AuthorizedAdministratorListPage'; //我的设置-授权管理员
|
|
||||||
static const lockGroupListPage = '/LockGroupListPage'; //我的设置-锁分组
|
static const lockGroupListPage = '/LockGroupListPage'; //我的设置-锁分组
|
||||||
static const lockItemListPage = '/LockItemListPage'; //锁分组-锁列表
|
static const lockItemListPage = '/LockItemListPage'; //锁分组-锁列表
|
||||||
static const transferSmartLockPage = '/transferSmartLockPage'; //转移智能锁
|
static const transferSmartLockPage = '/transferSmartLockPage'; //转移智能锁
|
||||||
static const recipientInformationPage = '/recipientInformationPage'; //接受人信息
|
static const recipientInformationPage = '/recipientInformationPage'; //接受人信息
|
||||||
static const selectBranchPage = '/SelectBranchPage'; //选择分店
|
static const selectBranchPage = '/SelectBranchPage'; //选择分店
|
||||||
static const selectGetewayListPage = '/selectGetewayListPage'; //选择网关
|
static const selectGetewayListPage = '/selectGetewayListPage'; //选择网关
|
||||||
static const addAuthorizedAdministratorPage =
|
static const addAuthorizedAdministratorPage = '/addAuthorizedAdministratorPage'; //添加授权管理员
|
||||||
'/addAuthorizedAdministratorPage'; //添加授权管理员
|
|
||||||
static const ownedKeyListPage = '/ownedKeyListPage'; //拥有的钥匙
|
static const ownedKeyListPage = '/ownedKeyListPage'; //拥有的钥匙
|
||||||
|
|
||||||
static const starLockLoginPage = '/StarLockLoginPage'; // 登录
|
static const starLockLoginPage = '/StarLockLoginPage'; // 登录
|
||||||
static const starLockRegisterPage = '/StarLockRegisterPage'; // 注册
|
static const starLockRegisterPage = '/StarLockRegisterPage'; // 注册
|
||||||
static const starLockForgetPasswordPage =
|
static const starLockForgetPasswordPage = '/StarLockForgetPasswordPage'; // 忘记密码
|
||||||
'/StarLockForgetPasswordPage'; // 忘记密码
|
|
||||||
static const seletCountryRegionPage = '/SeletCountryRegionPage'; // 选择国家和地区
|
static const seletCountryRegionPage = '/SeletCountryRegionPage'; // 选择国家和地区
|
||||||
|
static const safetyVerificationPage = '/SafetyVerificationPage'; // 安全验证
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AppRouters {
|
abstract class AppRouters {
|
||||||
@ -388,7 +385,7 @@ abstract class AppRouters {
|
|||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.starLockRegisterPage,
|
name: Routers.starLockRegisterPage,
|
||||||
page: () => const StarLockRegisterPage(),
|
page: () => const StarLockRegisterPage(), binding:StarLockRegisterBinding()
|
||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.starLockForgetPasswordPage,
|
name: Routers.starLockForgetPasswordPage,
|
||||||
@ -664,32 +661,47 @@ abstract class AppRouters {
|
|||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.authorizedAdministratorListPage,
|
name: Routers.authorizedAdministratorListPage,
|
||||||
page: () => const AuthorizedAdministratorListPage()),
|
page: () => const AuthorizedAdministratorListPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.lockUserManageLisPage,
|
name: Routers.lockUserManageLisPage,
|
||||||
page: () => const LockUserManageListListPage()),
|
page: () => const LockUserManageListListPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.lockGroupListPage, page: () => const LockGroupListPage()),
|
name: Routers.lockGroupListPage, page: () => const LockGroupListPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.lockItemListPage, page: () => const LockItemListPage()),
|
name: Routers.lockItemListPage, page: () => const LockItemListPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.transferSmartLockPage,
|
name: Routers.transferSmartLockPage,
|
||||||
page: () => const TransferSmartLockPage()),
|
page: () => const TransferSmartLockPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.recipientInformationPage,
|
name: Routers.recipientInformationPage,
|
||||||
page: () => const RecipientInformationPage()),
|
page: () => const RecipientInformationPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.selectBranchPage, page: () => const SelectBranchPage()),
|
name: Routers.selectBranchPage, page: () => const SelectBranchPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.selectGetewayListPage,
|
name: Routers.selectGetewayListPage,
|
||||||
page: () => const SelectGetewayListPage()),
|
page: () => const SelectGetewayListPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.minePersonInfoEditEmailPage,
|
name: Routers.minePersonInfoEditEmailPage,
|
||||||
page: () => const MinePersonInfoEditEmailPage()),
|
page: () => const MinePersonInfoEditEmailPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.addAuthorizedAdministratorPage,
|
name: Routers.addAuthorizedAdministratorPage,
|
||||||
page: () => const AddAuthorizedAdministratorPage()),
|
page: () => const AddAuthorizedAdministratorPage()
|
||||||
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage())
|
name: Routers.safetyVerificationPage,
|
||||||
|
page: () => const SafetyVerificationPage()
|
||||||
|
),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()
|
||||||
|
)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
529
star_lock/lib/common/safetyVerification_page.dart
Normal file
529
star_lock/lib/common/safetyVerification_page.dart
Normal file
File diff suppressed because one or more lines are too long
6
star_lock/lib/login/login/starLock_login_logic.dart
Normal file
6
star_lock/lib/login/login/starLock_login_logic.dart
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class StarLockLoginLogic extends GetxController{
|
||||||
|
|
||||||
|
}
|
||||||
5
star_lock/lib/login/login/starLock_login_state.dart
Normal file
5
star_lock/lib/login/login/starLock_login_state.dart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
class StarLockLoginState{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'starLock_register_logic.dart';
|
||||||
|
|
||||||
|
class StarLockRegisterBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => StarLockRegisterLogic());
|
||||||
|
}
|
||||||
|
}
|
||||||
53
star_lock/lib/login/register/starLock_register_logic.dart
Normal file
53
star_lock/lib/login/register/starLock_register_logic.dart
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../network/api_repository.dart';
|
||||||
|
import '../../tools/baseGetXController.dart';
|
||||||
|
import 'starLock_register_state.dart';
|
||||||
|
|
||||||
|
class StarLockRegisterLogic extends BaseGetXController{
|
||||||
|
final StarLockRegisterState state = StarLockRegisterState();
|
||||||
|
|
||||||
|
void register() async{
|
||||||
|
var entity = await ApiRepository.to.register(
|
||||||
|
state.countryCode.value,
|
||||||
|
state.countryCode.value,
|
||||||
|
state.phoneOrEmailStr.value,
|
||||||
|
state.pwd.value,
|
||||||
|
"gdasdfasdfasdf",
|
||||||
|
state.verificationCode.value
|
||||||
|
);
|
||||||
|
if(entity.code!.codeIsSuccessful){
|
||||||
|
await loginSuccess(loginEntity: entity);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void checkNext(TextEditingController controller) {
|
||||||
|
changeInput(controller);
|
||||||
|
}
|
||||||
|
|
||||||
|
void changeInput(TextEditingController controller) {
|
||||||
|
if(controller == state.phoneOrEmailController){
|
||||||
|
state.phoneOrEmailStr.value = controller.text;
|
||||||
|
}
|
||||||
|
if(controller == state.pwdController) {
|
||||||
|
state.pwd.value = controller.text;
|
||||||
|
}
|
||||||
|
if(controller == state.sureController) {
|
||||||
|
state.surePwd.value = controller.text;
|
||||||
|
}
|
||||||
|
if(controller == state.codeController) {
|
||||||
|
state.verificationCode.value = controller.text;
|
||||||
|
}
|
||||||
|
_resetCanSub();
|
||||||
|
}
|
||||||
|
|
||||||
|
void _resetCanSub(){
|
||||||
|
state.canSub.value = state.pwdIsOK && state.codeIsOK && (state.isIphoneType.value ? state.isIphone : state.isEmail);
|
||||||
|
print("22222:${state.canSub.value}");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -12,6 +12,7 @@ import '../../tools/tf_loginInput.dart';
|
|||||||
import '../../tools/submitBtn.dart';
|
import '../../tools/submitBtn.dart';
|
||||||
import '../../tools/titleAppBar.dart';
|
import '../../tools/titleAppBar.dart';
|
||||||
import '../../translations/trans_lib.dart';
|
import '../../translations/trans_lib.dart';
|
||||||
|
import 'starLock_register_logic.dart';
|
||||||
|
|
||||||
class StarLockRegisterPage extends StatefulWidget {
|
class StarLockRegisterPage extends StatefulWidget {
|
||||||
const StarLockRegisterPage({Key? key}) : super(key: key);
|
const StarLockRegisterPage({Key? key}) : super(key: key);
|
||||||
@ -21,12 +22,12 @@ class StarLockRegisterPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||||
final TextEditingController _phoneController = TextEditingController();
|
|
||||||
final TextEditingController _pwdController = TextEditingController();
|
final logic = Get.find<StarLockRegisterLogic>();
|
||||||
final TextEditingController _codeController = TextEditingController();
|
final state = Get.find<StarLockRegisterLogic>().state;
|
||||||
|
|
||||||
late Timer _timer;
|
late Timer _timer;
|
||||||
int _seconds = 60;
|
final int _seconds = 60;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -41,10 +42,21 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
right: 40.w
|
right: 40.w
|
||||||
),
|
),
|
||||||
children: [
|
children: [
|
||||||
topSeletCountryAndRegionWidget (),
|
topSeletCountryAndRegionWidget(),
|
||||||
middleTFWidget (),
|
middleTFWidget(),
|
||||||
SubmitBtn(btnName: "${TranslationLoader.lanKeys!.reset!.tr} ${TranslationLoader.lanKeys!.password!.tr}", fontSize: 30.sp, borderRadius: 20.w, padding: EdgeInsets.only(top: 25.w, bottom: 25.w), onClick: (){
|
Obx(() {
|
||||||
|
print("11111:${state.canSub.value}");
|
||||||
|
return SubmitBtn(
|
||||||
|
btnName: TranslationLoader.lanKeys!.register!.tr,
|
||||||
|
// backgroundColorList: state.canSub.value ? [AppColors.mainColor] :[Colors.grey],
|
||||||
|
fontSize: 30.sp,
|
||||||
|
borderRadius: 20.w,
|
||||||
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
|
isDisabled: state.canSub.value,
|
||||||
|
onClick: state.canSub.value ? (){
|
||||||
|
logic.register();
|
||||||
|
}:null
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -123,8 +135,12 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
),
|
),
|
||||||
SizedBox(height:60.h),
|
SizedBox(height:60.h),
|
||||||
GestureDetector(
|
GestureDetector(
|
||||||
onTap: (){
|
onTap: () async {
|
||||||
Navigator.pushNamed(context, Routers.seletCountryRegionPage);
|
Navigator.pushNamed(context, Routers.seletCountryRegionPage);
|
||||||
|
var result = await Navigator.pushNamed(context, Routers.seletCountryRegionPage);
|
||||||
|
logic.state.countryCode.value = (result as Map<String, dynamic>)['code'];
|
||||||
|
logic.state.countryId.value = result["countryId"];
|
||||||
|
// print("路由返回值: ${result}, countryCode:${logic.state.countryCode} ,countryId:${logic.state.countryId}");
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 70.h,
|
height: 70.h,
|
||||||
@ -133,12 +149,12 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width:5.w),
|
SizedBox(width:5.w),
|
||||||
Expanded(child: Text(TranslationLoader.lanKeys!.countryAndRegion!.tr, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w500))),
|
Expanded(child: Text(TranslationLoader.lanKeys!.countryAndRegion!.tr, style: TextStyle(fontSize: 26.sp))),
|
||||||
SizedBox(width:20.w),
|
SizedBox(width:20.w),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
Text("中国+86", textAlign: TextAlign.end, style: TextStyle(fontSize: 30.sp, fontWeight: FontWeight.w500),)
|
Text("中国+86", textAlign: TextAlign.end, style: TextStyle(fontSize: 26.sp),)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(width:5.w),
|
SizedBox(width:5.w),
|
||||||
@ -156,7 +172,11 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
LoginInput(
|
LoginInput(
|
||||||
controller: _phoneController,
|
controller: state.phoneOrEmailController,
|
||||||
|
onchangeAction: (v) {
|
||||||
|
print("3333333:${v}");
|
||||||
|
logic.checkNext(state.phoneOrEmailController);
|
||||||
|
},
|
||||||
leftWidget:Padding(
|
leftWidget:Padding(
|
||||||
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
||||||
child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,),
|
child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,),
|
||||||
@ -170,7 +190,10 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 10.w),
|
SizedBox(height: 10.w),
|
||||||
LoginInput(
|
LoginInput(
|
||||||
controller: _pwdController,
|
controller: state.pwdController,
|
||||||
|
onchangeAction: (v) {
|
||||||
|
logic.checkNext(state.pwdController);
|
||||||
|
},
|
||||||
isPwd: true,
|
isPwd: true,
|
||||||
leftWidget:Padding(
|
leftWidget:Padding(
|
||||||
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
||||||
@ -185,7 +208,10 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
Text(TranslationLoader.lanKeys!.registerPasswordTip!.tr, style: TextStyle(color: const Color(0xFF999999), fontSize: 26.sp),),
|
Text(TranslationLoader.lanKeys!.registerPasswordTip!.tr, style: TextStyle(color: const Color(0xFF999999), fontSize: 26.sp),),
|
||||||
SizedBox(height: 10.w),
|
SizedBox(height: 10.w),
|
||||||
LoginInput(
|
LoginInput(
|
||||||
controller: _pwdController,
|
controller: state.sureController,
|
||||||
|
onchangeAction: (v) {
|
||||||
|
logic.checkNext(state.sureController);
|
||||||
|
},
|
||||||
isPwd: true,
|
isPwd: true,
|
||||||
leftWidget:Padding(
|
leftWidget:Padding(
|
||||||
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
||||||
@ -201,8 +227,11 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: LoginInput(
|
child: LoginInput(
|
||||||
controller: _codeController,
|
controller: state.codeController,
|
||||||
isPwd: true,
|
isPwd: true,
|
||||||
|
onchangeAction: (v) {
|
||||||
|
logic.checkNext(state.codeController);
|
||||||
|
},
|
||||||
leftWidget:Padding(
|
leftWidget:Padding(
|
||||||
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 5.w),
|
||||||
child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,),
|
child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,),
|
||||||
@ -231,6 +260,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
onTap: (){
|
onTap: (){
|
||||||
|
Navigator.pushNamed(context, Routers.safetyVerificationPage);
|
||||||
if(_seconds==60){
|
if(_seconds==60){
|
||||||
// _setVerify();
|
// _setVerify();
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
32
star_lock/lib/login/register/starLock_register_state.dart
Normal file
32
star_lock/lib/login/register/starLock_register_state.dart
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
|
||||||
|
import 'package:flustars/flustars.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class StarLockRegisterState{
|
||||||
|
|
||||||
|
final TextEditingController phoneOrEmailController = TextEditingController();
|
||||||
|
final TextEditingController pwdController = TextEditingController();
|
||||||
|
final TextEditingController sureController = TextEditingController();
|
||||||
|
final TextEditingController codeController = TextEditingController();
|
||||||
|
|
||||||
|
var countryCode = ''.obs;
|
||||||
|
var countryId = ''.obs;
|
||||||
|
var phoneOrEmailStr = ''.obs;
|
||||||
|
var pwd = ''.obs;
|
||||||
|
var surePwd = ''.obs;
|
||||||
|
var verificationCode = ''.obs;
|
||||||
|
var isIphoneType = true.obs;
|
||||||
|
var canSub = false.obs;
|
||||||
|
bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value);
|
||||||
|
bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value);
|
||||||
|
bool get pwdIsOK => pwd.value.isNotEmpty && (pwd.value == surePwd.value);
|
||||||
|
bool get codeIsOK => verificationCode.value.isNotEmpty;
|
||||||
|
|
||||||
|
void onClose() {
|
||||||
|
phoneOrEmailController.dispose();
|
||||||
|
pwdController.dispose();
|
||||||
|
sureController.dispose();
|
||||||
|
codeController.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -14,12 +14,24 @@ class SeletCountryRegionPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _SeletCountryRegionPageState extends State<SeletCountryRegionPage> {
|
class _SeletCountryRegionPageState extends State<SeletCountryRegionPage> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
resizeToAvoidBottomInset: false,
|
resizeToAvoidBottomInset: false,
|
||||||
backgroundColor: const Color(0xFFFFFFFF),
|
backgroundColor: const Color(0xFFFFFFFF),
|
||||||
appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys!.selet!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}", haveBack:true, backgroundColor: AppColors.mainColor),
|
appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys!.selet!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}", haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [
|
||||||
|
TextButton(
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.reset!.tr,
|
||||||
|
style: const TextStyle(color: Colors.white),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context, {'code': "+86", "countryId": "9"});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],),
|
||||||
body:ListView(
|
body:ListView(
|
||||||
padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w),
|
padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w),
|
||||||
children: [
|
children: [
|
||||||
@ -28,4 +40,9 @@ class _SeletCountryRegionPageState extends State<SeletCountryRegionPage> {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_backBtnAction(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/tools/app_manager.dart';
|
import 'package:star_lock/tools/app_manager.dart';
|
||||||
|
import 'package:star_lock/tools/bindings/app_binding.dart';
|
||||||
import 'package:star_lock/tools/device_info_service.dart';
|
import 'package:star_lock/tools/device_info_service.dart';
|
||||||
import 'package:star_lock/tools/platform_info_services.dart';
|
import 'package:star_lock/tools/platform_info_services.dart';
|
||||||
import 'package:star_lock/tools/reactiveBlueTool/getx_ble.dart';
|
import 'package:star_lock/tools/reactiveBlueTool/getx_ble.dart';
|
||||||
@ -94,6 +96,8 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
|||||||
),
|
),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
getPages: AppRouters.routePages,
|
getPages: AppRouters.routePages,
|
||||||
|
builder: EasyLoading.init(),
|
||||||
|
initialBinding: AppBindings(),
|
||||||
initialRoute: '/');
|
initialRoute: '/');
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -31,29 +31,39 @@ class _StarLockMainState extends State<StarLockMain> with BaseWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
// final logic = Get.put(GetxBle());
|
|
||||||
// // Get.lazyPut(()=>GetxBle());
|
final logic = Get.put(GetxBle());
|
||||||
// logic.scanner.startScan([]);
|
// Get.lazyPut(()=>GetxBle());
|
||||||
|
logic.scanner.startScan([]);
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: const Color(0xFFF5F5F5),
|
backgroundColor: const Color(0xFFF5F5F5),
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: TranslationLoader.lanKeys!.starLock!.tr,
|
barTitle: TranslationLoader.lanKeys!.starLock!.tr,
|
||||||
haveBack: false,
|
haveBack: false,
|
||||||
haveOtherLeftWidget: true,
|
haveOtherLeftWidget: true,
|
||||||
leftWidget: Builder(
|
leftWidget: Builder(
|
||||||
builder: (context) => IconButton(
|
builder: (context) => IconButton(
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
"images/main/mainLeft_menu_icon.png",
|
"images/main/mainLeft_menu_icon.png",
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
width: 44.w,
|
width: 44.w,
|
||||||
height: 44.w,
|
height: 44.w,
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Scaffold.of(context).openDrawer();
|
Scaffold.of(context).openDrawer();
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor,
|
||||||
|
actionsList: [
|
||||||
|
TextButton(
|
||||||
|
child: Text("", style: const TextStyle(color: Colors.white)),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pushNamed(context, Routers.starLockLoginPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
drawer: Drawer(
|
drawer: Drawer(
|
||||||
width: 1.sw / 3 * 2,
|
width: 1.sw / 3 * 2,
|
||||||
child: StarLockMinePage(),
|
child: StarLockMinePage(),
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
|
|
||||||
abstract class Api {
|
abstract class Api {
|
||||||
|
|
||||||
final String baseUrl = "";
|
// final String baseUrl = "http://test.lock.star-lock.cn/api"; // 葛工
|
||||||
|
final String baseUrl = "https://lock.star-lock.cn/api";// 测试环境
|
||||||
|
|
||||||
final String getVerificationCodeUrl = '/api/v1/vcode/email';
|
final String getVerificationCodeUrl = '/api/v1/vcode/email';
|
||||||
|
final String registerUrl = '/user/register';
|
||||||
final String registerUrl = '/api/v1/vcode/email';
|
|
||||||
|
|
||||||
final String loginUrl = '/api/v1/vcode/email';
|
final String loginUrl = '/api/v1/vcode/email';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,10 +8,14 @@ class ApiProvider extends BaseProvider {
|
|||||||
'email':email,
|
'email':email,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<Response> register(String email, String vCode,String password) => post(registerUrl.toUrl, null,query: {
|
Future<Response> register(String countryCode, String countryId, String mobile, String password, String uniqueid, String verificationCode) => post(registerUrl.toUrl, null,query: {
|
||||||
'email':email,
|
'countryCode':countryCode,
|
||||||
'vCode':vCode,
|
'countryId':countryId,
|
||||||
"password":password
|
"mobile":mobile,
|
||||||
|
'password':password,
|
||||||
|
'platId':"2",
|
||||||
|
"uniqueid":uniqueid,
|
||||||
|
'verificationCode':verificationCode,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<Response> login(String email,String password) => post(loginUrl.toUrl, null,query: {'email':email,'password':password});
|
Future<Response> login(String email,String password) => post(loginUrl.toUrl, null,query: {'email':email,'password':password});
|
||||||
@ -19,5 +23,5 @@ class ApiProvider extends BaseProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
String get toUrl => '/$this';
|
String get toUrl => '$this';
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
import 'api_provider.dart';
|
import 'api_provider.dart';
|
||||||
|
|
||||||
class ApiRepository {
|
class ApiRepository {
|
||||||
@ -14,11 +15,11 @@ class ApiRepository {
|
|||||||
// return VerficationCodeEntity.fromJson(res.body);
|
// return VerficationCodeEntity.fromJson(res.body);
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Future<LoginEntity> register(String email, String vCode,String password) async {
|
Future<LoginEntity> register(String countryCode, String countryId, String mobile, String password, String uniqueid, String verificationCode) async {
|
||||||
// final res = await apiProvider.register(email,vCode,SecrecyUtils.md5EncodeUpperCase(input: password));
|
final res = await apiProvider.register(countryCode, countryId, mobile, password, uniqueid, verificationCode);
|
||||||
// return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// Future<LoginEntity> login({String? email,String? password}) async {
|
// Future<LoginEntity> login({String? email,String? password}) async {
|
||||||
// final res = await apiProvider.login(email,SecrecyUtils.md5EncodeUpperCase(input: password));
|
// final res = await apiProvider.login(email,SecrecyUtils.md5EncodeUpperCase(input: password));
|
||||||
// return LoginEntity.fromJson(res.body);
|
// return LoginEntity.fromJson(res.body);
|
||||||
|
|||||||
@ -8,8 +8,9 @@ import '../tools/platform_info_services.dart';
|
|||||||
import '../tools/store_service.dart';
|
import '../tools/store_service.dart';
|
||||||
|
|
||||||
FutureOr<Request> requestInterceptor(Request request) async {
|
FutureOr<Request> requestInterceptor(Request request) async {
|
||||||
request.headers['User-Agent'] = 'Mower/CANDELA_18E/${PlatformInfoService.to.info.version}/${PlatformInfoService.to.info.buildNumber}/${GetPlatform.isAndroid ? 'Android' : 'iOS'}';
|
request.headers['User-Agent'] = 'StarLock/${PlatformInfoService.to.info.version}/${PlatformInfoService.to.info.buildNumber}/${GetPlatform.isAndroid ? 'Android' : 'iOS'}';
|
||||||
request.headers['Accept-Language'] = 'zh_CN';
|
request.headers['Accept-Language'] = 'zh_CN';
|
||||||
request.headers['token'] = StoreService.to.userToken!;
|
// request.headers['token'] = StoreService.to.userToken!;
|
||||||
|
request.headers['Authorization'] = "Bearer ${StoreService.to.userToken!}";
|
||||||
return request;
|
return request;
|
||||||
}
|
}
|
||||||
94
star_lock/lib/tools/baseGetXController.dart
Normal file
94
star_lock/lib/tools/baseGetXController.dart
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
|
||||||
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
|
import '../translations/trans_lib.dart';
|
||||||
|
import 'manager/client_manager.dart';
|
||||||
|
|
||||||
|
class BaseGetXController extends GetxController{
|
||||||
|
int currentTimeSeconds = 0;
|
||||||
|
|
||||||
|
bool currentPage = true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
super.onReady();
|
||||||
|
Get.log('$runtimeType onReady');
|
||||||
|
currentPage = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
// TODO: implement onDelete
|
||||||
|
InternalFinalCallback<void> get onDelete => super.onDelete;
|
||||||
|
|
||||||
|
@override
|
||||||
|
// TODO: implement onStart
|
||||||
|
InternalFinalCallback<void> get onStart => super.onStart;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
Get.log('$runtimeType onInit ');
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
super.onClose();
|
||||||
|
currentPage = false;
|
||||||
|
Get.log('onClose -----> $runtimeType');
|
||||||
|
}
|
||||||
|
|
||||||
|
operationFailedCallBack(e){
|
||||||
|
showOperationFailed();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future delay({Duration? duration,Function? something}) => Future.delayed(duration ?? 500. milliseconds,something as FutureOr Function()?);
|
||||||
|
|
||||||
|
void showEasyLoading() => EasyLoading.show();
|
||||||
|
|
||||||
|
void dismissEasyLoading() => EasyLoading.dismiss();
|
||||||
|
|
||||||
|
void showToast(String status,{Function? something}) {
|
||||||
|
EasyLoading.showToast(status,duration: 2000.milliseconds);
|
||||||
|
if(something != null) {
|
||||||
|
delay(duration: 2100.milliseconds,something: something);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showError(String status,{Function? something}) {
|
||||||
|
EasyLoading.showError(status,duration: 2000.milliseconds);
|
||||||
|
if(something != null) {
|
||||||
|
delay(duration: 2100.milliseconds,something: something);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showSuccess(String status,{Function? something}) {
|
||||||
|
EasyLoading.showSuccess(status,duration: 1500.milliseconds);
|
||||||
|
if(something != null) {
|
||||||
|
delay(duration: 2000.milliseconds,something: something);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void showOperationSuccessful({String? status,Function? something}) => showSuccess( status ?? "成功",something: something);
|
||||||
|
void showOperationFailed({String? status, Function? something}) => showError( status ?? "失败",something: something);
|
||||||
|
|
||||||
|
void logOff() async {
|
||||||
|
await ClientManager().logOff();
|
||||||
|
Get.offAllNamed(Routers.starLockLoginPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future loginSuccess({LoginEntity? loginEntity, bool byToken = false}) async => ClientManager().loginSuccess(loginEntity: loginEntity,byToken: byToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///Extension_Int
|
||||||
|
extension Extension_Int on int {
|
||||||
|
bool get codeIsSuccessful => this == 1;
|
||||||
|
bool get msgCodeIsSuccessful => this == 1;
|
||||||
|
}
|
||||||
14
star_lock/lib/tools/bindings/app_binding.dart
Normal file
14
star_lock/lib/tools/bindings/app_binding.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../network/api_provider.dart';
|
||||||
|
import '../../network/api_repository.dart';
|
||||||
|
|
||||||
|
class AppBindings extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.put(ApiProvider());
|
||||||
|
Get.put(ApiRepository(Get.find<ApiProvider>()));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -30,6 +30,7 @@ class SubmitBtn extends StatelessWidget {
|
|||||||
|
|
||||||
bool? isDelete;
|
bool? isDelete;
|
||||||
|
|
||||||
|
bool? isDisabled;
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
required this.btnName,
|
required this.btnName,
|
||||||
@ -41,7 +42,9 @@ class SubmitBtn extends StatelessWidget {
|
|||||||
this.width,
|
this.width,
|
||||||
this.backgroundColorList,
|
this.backgroundColorList,
|
||||||
this.isDelete,
|
this.isDelete,
|
||||||
this.fontSize})
|
this.fontSize,
|
||||||
|
this.isDisabled,
|
||||||
|
})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -51,8 +54,7 @@ class SubmitBtn extends StatelessWidget {
|
|||||||
height: 60.h,
|
height: 60.h,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor:
|
backgroundColor: isDisabled == false ? Colors.grey : (isDelete == true ? Colors.red : AppColors.mainColor),
|
||||||
isDelete == true ? Colors.red : AppColors.mainColor,
|
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (onClick != null) {
|
if (onClick != null) {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
* 登录注册页面 input
|
* 登录注册页面 input
|
||||||
* */
|
* */
|
||||||
|
|
||||||
|
typedef BlockStrCallback = void Function(dynamic textStr);
|
||||||
class LoginInput extends StatelessWidget {
|
class LoginInput extends StatelessWidget {
|
||||||
TextEditingController? controller;
|
TextEditingController? controller;
|
||||||
List<TextInputFormatter>? inputFormatters;
|
List<TextInputFormatter>? inputFormatters;
|
||||||
@ -18,6 +19,7 @@ class LoginInput extends StatelessWidget {
|
|||||||
String? label;
|
String? label;
|
||||||
bool? isPwd;
|
bool? isPwd;
|
||||||
Widget? rightSlot;
|
Widget? rightSlot;
|
||||||
|
BlockStrCallback? onchangeAction;
|
||||||
LoginInput(
|
LoginInput(
|
||||||
{Key? key,
|
{Key? key,
|
||||||
required this.controller,
|
required this.controller,
|
||||||
@ -29,7 +31,8 @@ class LoginInput extends StatelessWidget {
|
|||||||
this.background,
|
this.background,
|
||||||
this.hintText,
|
this.hintText,
|
||||||
this.isHaveLeftWidget = true,
|
this.isHaveLeftWidget = true,
|
||||||
this.leftWidget})
|
this.leftWidget,
|
||||||
|
this.onchangeAction})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -44,6 +47,7 @@ class LoginInput extends StatelessWidget {
|
|||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
controller: controller,
|
controller: controller,
|
||||||
|
onChanged: onchangeAction,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
|
|||||||
@ -6,10 +6,14 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <aj_captcha_flutter/aj_captcha_flutter_plugin.h>
|
||||||
#include <file_selector_linux/file_selector_plugin.h>
|
#include <file_selector_linux/file_selector_plugin.h>
|
||||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||||
|
|
||||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||||
|
g_autoptr(FlPluginRegistrar) aj_captcha_flutter_registrar =
|
||||||
|
fl_plugin_registry_get_registrar_for_plugin(registry, "AjCaptchaFlutterPlugin");
|
||||||
|
aj_captcha_flutter_plugin_register_with_registrar(aj_captcha_flutter_registrar);
|
||||||
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||||
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
aj_captcha_flutter
|
||||||
file_selector_linux
|
file_selector_linux
|
||||||
url_launcher_linux
|
url_launcher_linux
|
||||||
)
|
)
|
||||||
|
|||||||
@ -5,16 +5,20 @@
|
|||||||
import FlutterMacOS
|
import FlutterMacOS
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
|
import aj_captcha_flutter
|
||||||
import device_info_plus
|
import device_info_plus
|
||||||
import file_selector_macos
|
import file_selector_macos
|
||||||
import package_info_plus
|
import package_info_plus
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
|
import shared_preferences_foundation
|
||||||
import url_launcher_macos
|
import url_launcher_macos
|
||||||
|
|
||||||
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||||
|
AjCaptchaFlutterPlugin.register(with: registry.registrar(forPlugin: "AjCaptchaFlutterPlugin"))
|
||||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,8 @@ dependencies:
|
|||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
|
||||||
|
# 常用工具类
|
||||||
|
flustars: ^2.0.1
|
||||||
# 状态管理
|
# 状态管理
|
||||||
get: ^4.6.5
|
get: ^4.6.5
|
||||||
# 获取设备信息
|
# 获取设备信息
|
||||||
@ -69,11 +71,12 @@ dependencies:
|
|||||||
#蓝牙
|
#蓝牙
|
||||||
flutter_reactive_ble: ^5.1.1
|
flutter_reactive_ble: ^5.1.1
|
||||||
# flutter_blue_plus: ^1.10.5
|
# flutter_blue_plus: ^1.10.5
|
||||||
|
#
|
||||||
event_bus: ^2.0.0
|
event_bus: ^2.0.0
|
||||||
|
#菊花
|
||||||
flutter_easyloading: ^3.0.5
|
flutter_easyloading: ^3.0.5
|
||||||
|
#图形验证码
|
||||||
|
aj_captcha_flutter: ^0.0.1
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|||||||
@ -6,10 +6,13 @@
|
|||||||
|
|
||||||
#include "generated_plugin_registrant.h"
|
#include "generated_plugin_registrant.h"
|
||||||
|
|
||||||
|
#include <aj_captcha_flutter/aj_captcha_flutter_plugin_c_api.h>
|
||||||
#include <file_selector_windows/file_selector_windows.h>
|
#include <file_selector_windows/file_selector_windows.h>
|
||||||
#include <url_launcher_windows/url_launcher_windows.h>
|
#include <url_launcher_windows/url_launcher_windows.h>
|
||||||
|
|
||||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||||
|
AjCaptchaFlutterPluginCApiRegisterWithRegistrar(
|
||||||
|
registry->GetRegistrarForPlugin("AjCaptchaFlutterPluginCApi"));
|
||||||
FileSelectorWindowsRegisterWithRegistrar(
|
FileSelectorWindowsRegisterWithRegistrar(
|
||||||
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||||
UrlLauncherWindowsRegisterWithRegistrar(
|
UrlLauncherWindowsRegisterWithRegistrar(
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
list(APPEND FLUTTER_PLUGIN_LIST
|
list(APPEND FLUTTER_PLUGIN_LIST
|
||||||
|
aj_captcha_flutter
|
||||||
file_selector_windows
|
file_selector_windows
|
||||||
url_launcher_windows
|
url_launcher_windows
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user