feat: login password invisiable pwd

This commit is contained in:
louis 2024-04-10 11:43:59 +08:00
parent 9361c8a9df
commit 322368339f
12 changed files with 69 additions and 81 deletions

View File

@ -3,7 +3,6 @@ import 'package:get/get.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:sk_base_mobile/apis/api.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/config.dart';
import 'package:sk_base_mobile/constants/bg_color.dart';
import 'package:sk_base_mobile/constants/constants.dart';
import 'package:sk_base_mobile/models/user_info.model.dart';
@ -30,14 +29,6 @@ class HrManagePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
// return Column(
// children: [
// Expanded(
// child: Material(
// child: EditUserInfo(),
// ))
// ],
// );
return GestureDetector(
onTap: () {
//
@ -125,7 +116,7 @@ class HrManagePage extends StatelessWidget {
doSearch('');
},
)),
hint: '查询员工',
hint: '查询员工 姓名、手机号、邮箱',
isDense: true,
contentPadding:
EdgeInsets.symmetric(vertical: ScreenAdaper.height(10)),
@ -134,23 +125,27 @@ class HrManagePage extends StatelessWidget {
SizedBox(
width: ScreenAdaper.width(10),
),
SkInk(
border: Border.all(color: AppTheme.grey.withOpacity(0.8)),
borderRadius: BorderRadius.circular(ScreenAdaper.sp(15)),
onTap: () {},
child: SizedBox(
width: ScreenAdaper.height(65),
height: ScreenAdaper.height(65),
child: Icon(
Icons.filter_list_sharp,
size: ScreenAdaper.height(50),
),
),
)
buildFilterBtn()
]),
);
}
Widget buildFilterBtn() {
return SkInk(
border: Border.all(color: AppTheme.grey.withOpacity(0.8)),
borderRadius: BorderRadius.circular(ScreenAdaper.sp(15)),
onTap: () {},
child: SizedBox(
width: ScreenAdaper.height(65),
height: ScreenAdaper.height(65),
child: Icon(
Icons.filter_list_sharp,
size: ScreenAdaper.height(50),
),
),
);
}
Widget buildUserCard(int index) {
return SkInk(
onTap: () {

View File

@ -6,9 +6,7 @@ import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/constants/enum.dart';
import 'package:sk_base_mobile/db_helper/db_help.dart';
import 'package:sk_base_mobile/screens/inventory_inout/components/inventory_inout_info.dart';
import 'package:sk_base_mobile/screens/landing/landing_controller.dart';
import 'package:sk_base_mobile/screens/new_inventory_inout/new_inventory_inout.dart';
import 'package:sk_base_mobile/services/app_info.service.dart';
import 'package:sk_base_mobile/util/date.util.dart';
import 'package:sk_base_mobile/util/modal.util.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';

View File

@ -1,16 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/apis/api.dart';
import 'package:sk_base_mobile/models/app_bottom_nav_item.dart';
import 'package:sk_base_mobile/screens/inventory/inventory.dart';
import 'package:sk_base_mobile/screens/inventory_inout/inventory_inout.dart';
import 'package:sk_base_mobile/screens/mine/mine.dart';
import 'package:sk_base_mobile/screens/workbench/workbench.dart';
import 'package:sk_base_mobile/services/app_info.service.dart';
import 'package:sk_base_mobile/util/device.util.dart';
import 'package:sk_base_mobile/util/modal.util.dart';
import '../../constants/constants.dart';
class LandingController extends GetxController {
RxInt currentIndex = 0.obs;

View File

@ -1,9 +1,6 @@
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/apis/api.dart';
import 'package:sk_base_mobile/util/device.util.dart';
import 'package:sk_base_mobile/util/snack_bar.util.dart';
import '../../constants/constants.dart';
import '../../store/auth.store.dart';
// import 'package:sentry/sentry.dart';
@ -14,6 +11,7 @@ class LoginController extends GetxController {
String username = '';
String password = '';
bool loading = false;
RxBool obscureText = true.obs;
Future<void> doLogin() async {
if (username.isEmpty || password.isEmpty) {
SnackBarUtil().warning('请填写用户名和密码');

View File

@ -94,6 +94,7 @@ class LoginScreen extends StatelessWidget {
final children = [
buildUserNameInput(),
Divider(
height: 1,
thickness: ScreenAdaper.height(2),
),
buildPasswordInput(),
@ -177,7 +178,7 @@ class LoginScreen extends StatelessWidget {
decoration: InputDecoration(
prefixIcon: Icon(
Icons.person_2_outlined,
size: ScreenAdaper.height(40),
size: ScreenAdaper.height(45),
),
hintText: '用户名',
hintStyle: TextStyle(fontSize: ScreenAdaper.height(25)),
@ -186,7 +187,7 @@ class LoginScreen extends StatelessWidget {
onFieldSubmitted: (value) {
_controller.passwordFocusNode.requestFocus();
},
style: TextStyle(fontSize: ScreenAdaper.height(25)),
style: TextStyle(fontSize: ScreenAdaper.height(30)),
onChanged: (value) {
_controller.username = value;
},
@ -194,26 +195,38 @@ class LoginScreen extends StatelessWidget {
}
Widget buildPasswordInput() {
return TextFormField(
decoration: InputDecoration(
prefixIcon: Icon(
Icons.lock_outlined,
size: ScreenAdaper.height(40),
),
errorStyle: TextStyle(fontSize: ScreenAdaper.height(20)),
hintText: '密码',
border: InputBorder.none,
focusedBorder: InputBorder.none),
obscureText: true,
focusNode: _controller.passwordFocusNode,
onFieldSubmitted: (value) {
_controller.doLogin();
},
style: TextStyle(fontSize: ScreenAdaper.height(25)),
onChanged: (value) {
_controller.password = value;
},
);
return Obx(() => TextFormField(
decoration: InputDecoration(
prefixIcon: Icon(
Icons.lock_outlined,
size: ScreenAdaper.height(45),
),
suffixIcon: GestureDetector(
onTap: () {
_controller.obscureText.value =
!_controller.obscureText.value;
},
child: Icon(
!_controller.obscureText.value
? Icons.visibility
: Icons.visibility_off,
size: ScreenAdaper.height(45),
),
),
errorStyle: TextStyle(fontSize: ScreenAdaper.height(20)),
hintText: '密码',
border: InputBorder.none,
focusedBorder: InputBorder.none),
obscureText: _controller.obscureText.value,
focusNode: _controller.passwordFocusNode,
onFieldSubmitted: (value) {
_controller.doLogin();
},
style: TextStyle(fontSize: ScreenAdaper.height(30)),
onChanged: (value) {
_controller.password = value;
},
));
}
Widget buildForgotPassword() {

View File

@ -3,7 +3,6 @@ import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/constants/bg_color.dart';
import 'package:sk_base_mobile/services/app_info.service.dart';
import 'package:sk_base_mobile/store/auth.store.dart';
import 'package:sk_base_mobile/util/device.util.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
class MineSettingsPage extends StatelessWidget {

View File

@ -1,10 +1,8 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
import 'package:sk_base_mobile/widgets/core/sk_ink.dart';
import 'package:sk_base_mobile/widgets/gradient_button.dart';
import 'package:sk_base_mobile/widgets/loading_indicator.dart';
class CascadeItem<T, Z> {
@ -28,7 +26,8 @@ class SkCascadePicker<T, Z> extends StatelessWidget {
final Function(List<CascadeItem<T, Z>>)? onConfirm;
SkCascadePicker(
{required Future<List<CascadeItem<T, Z>>> Function() getData,
{super.key,
required Future<List<CascadeItem<T, Z>>> Function() getData,
required List<CascadeItem<T, Z>> Function(SkCascadePickerController<T, Z>)
initialPageData,
required NextPageCallback<T, Z> nextPageData,
@ -209,7 +208,7 @@ class SkCascadePicker<T, Z> extends StatelessWidget {
height: tabHeight,
color: tabColor,
alignment: Alignment.center,
child: Container(
child: SizedBox(
// constraints: BoxConstraints(
// maxWidth: MediaQuery.of(Get.context!).size.width /
// cascadeController.pagesData.length -
@ -244,7 +243,7 @@ class SkCascadePicker<T, Z> extends StatelessWidget {
}
cascadeController.isAnimateTextHide = false;
if (i < cascadeController.pagesData.length - 1) {
widgets.add(Container(
widgets.add(SizedBox(
// color: Colors.red,
child: Icon(
Icons.arrow_right,
@ -269,13 +268,12 @@ class SkCascadePicker<T, Z> extends StatelessWidget {
item == cascadeController.selectedTabs[page]
? Padding(
padding: const EdgeInsets.all(5.0),
child: selectedIcon == null
? Icon(Icons.chevron_right,
child: selectedIcon ??
Icon(Icons.chevron_right,
size: ScreenAdaper.height(40),
color: activeColor)
: selectedIcon,
color: activeColor),
)
: SizedBox(),
: const SizedBox(),
Text(item.label,
style: item == cascadeController.selectedTabs[page]
? (itemTitleStyle ??
@ -500,7 +498,7 @@ class SkCascadePickerController<T, Z> extends GetxController
animateController.forward();
if (movePage) {
pageController.animateToPage(page,
curve: Curves.linear, duration: Duration(milliseconds: 500));
curve: Curves.linear, duration: const Duration(milliseconds: 500));
}
}
@ -516,7 +514,7 @@ class SkCascadePickerController<T, Z> extends GetxController
/// pageData:
/// currentPage: ,
/// selectIndex:
typedef void NextPageCallback<T, Z>(
typedef NextPageCallback<T, Z> = void Function(
Function(List<CascadeItem<T, Z>>) pageData,
int currentPage,
int selectIndex,

View File

@ -1,7 +1,5 @@
import 'package:flutter/material.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/constants/bg_color.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
class SkInk extends StatelessWidget {
final Widget? child;
@ -35,7 +33,7 @@ class SkInk extends StatelessWidget {
padding: padding,
decoration: BoxDecoration(
border: border,
color: color,
color: color ?? AppTheme.nearlyWhite,
gradient: gradient,
borderRadius: borderRadius,
),

View File

@ -8,7 +8,7 @@ import 'package:sk_base_mobile/widgets/loading_indicator.dart';
class SkMutiPickerDialog<T> extends StatelessWidget {
final SkMutiPickerDialogController controller;
Function(List<PickerItem> data)? onSelected;
final Function(List<PickerItem> data)? onSelected;
SkMutiPickerDialog(
{super.key,
required Future<List<PickerItem<T>>> Function() getData,

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
import 'package:sk_base_mobile/widgets/form_item/sk_form_item.dart';
import 'package:sk_base_mobile/widgets/form_item/sk_base_field.dart';

View File

@ -1,10 +1,8 @@
import 'dart:io';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:image_picker/image_picker.dart';
import 'package:sk_base_mobile/store/auth.store.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/widgets/fade_in_cache_image.dart';
import '../util/util.dart';

View File

@ -1,16 +1,13 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:get/get.dart';
import 'package:sk_base_mobile/app_theme.dart';
import 'package:sk_base_mobile/services/app_info.service.dart';
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
import 'package:sk_base_mobile/widgets/gradient_button.dart';
class UpgradeConfirm extends StatelessWidget {
void Function()? onConfirm;
bool forceUpgrade;
UpgradeConfirm({super.key, this.onConfirm, this.forceUpgrade = true});
final void Function()? onConfirm;
final bool forceUpgrade;
const UpgradeConfirm({super.key, this.onConfirm, this.forceUpgrade = true});
@override
Widget build(BuildContext context) {