fix : obscure password in auth
This commit is contained in:
@@ -24,7 +24,7 @@ class AuthLogic extends GetxController {
|
||||
|
||||
Rx<GlobalKey<FormState>> formKeyOtp = GlobalKey<FormState>().obs;
|
||||
Rx<GlobalKey<FormState>> formKeySentOtp = GlobalKey<FormState>().obs;
|
||||
Rx<TextEditingController> phoneNumberController = TextEditingController().obs;
|
||||
Rx<TextEditingController> usernameController = TextEditingController().obs;
|
||||
Rx<TextEditingController> passwordController = TextEditingController().obs;
|
||||
Rx<TextEditingController> phoneOtpNumberController =
|
||||
TextEditingController().obs;
|
||||
@@ -95,7 +95,7 @@ class AuthLogic extends GetxController {
|
||||
}
|
||||
|
||||
LoginRequestModel _buildLoginRequest() {
|
||||
final phone = phoneNumberController.value.text;
|
||||
final phone = usernameController.value.text;
|
||||
final pass = passwordController.value.text;
|
||||
final code = captchaController.textController.value.text;
|
||||
final key = captchaController.captchaKey.value;
|
||||
|
||||
@@ -144,7 +144,7 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
minWidth: 40,
|
||||
),
|
||||
),
|
||||
controller.phoneNumberController,
|
||||
controller.usernameController,
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
ObxValue(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: rasadyar_auth
|
||||
description: "A new Flutter project."
|
||||
version: 0.0.1
|
||||
version: 1.0.2
|
||||
publish_to: 'none'
|
||||
|
||||
|
||||
|
||||
@@ -2,12 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
enum RTextFieldVariant {
|
||||
normal,
|
||||
noBorder,
|
||||
password,
|
||||
passwordNoBorder,
|
||||
}
|
||||
enum RTextFieldVariant { normal, noBorder, password, passwordNoBorder }
|
||||
|
||||
class RTextField extends StatefulWidget {
|
||||
final TextEditingController controller;
|
||||
@@ -69,29 +64,21 @@ class RTextField extends StatefulWidget {
|
||||
this.onSubmitted,
|
||||
});
|
||||
|
||||
|
||||
@override
|
||||
State<RTextField> createState() => _RTextFieldState();
|
||||
|
||||
bool get _isPassword => variant == RTextFieldVariant.password;
|
||||
|
||||
bool get _noBorder => variant == RTextFieldVariant.noBorder;
|
||||
|
||||
bool get _passwordNoBorder => variant == RTextFieldVariant.passwordNoBorder;
|
||||
|
||||
|
||||
InputBorder get _inputBorder =>
|
||||
_noBorder || _passwordNoBorder ? InputBorder.none : OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(
|
||||
color: AppColor.lightGreyDarkActive,
|
||||
width: 1,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
InputBorder get _inputBorder => _noBorder || _passwordNoBorder
|
||||
? InputBorder.none
|
||||
: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(color: AppColor.lightGreyDarkActive, width: 1),
|
||||
);
|
||||
}
|
||||
|
||||
class _RTextFieldState extends State<RTextField> {
|
||||
@@ -103,7 +90,11 @@ class _RTextFieldState extends State<RTextField> {
|
||||
if (widget.initText != null) {
|
||||
widget.controller.text = widget.initText!;
|
||||
}
|
||||
obscure = widget.obscure;
|
||||
if (widget._isPassword) {
|
||||
obscure = true;
|
||||
} else {
|
||||
obscure = widget.obscure;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -126,10 +117,7 @@ class _RTextFieldState extends State<RTextField> {
|
||||
obscure = !obscure;
|
||||
});
|
||||
},
|
||||
child: Icon(
|
||||
obscure ? CupertinoIcons.eye : CupertinoIcons.eye_slash,
|
||||
color: AppColor.darkGreyDarkActive,
|
||||
),
|
||||
child: Icon(obscure ? CupertinoIcons.eye : CupertinoIcons.eye_slash, color: AppColor.darkGreyDarkActive),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -165,9 +153,7 @@ class _RTextFieldState extends State<RTextField> {
|
||||
hintText: widget.hintText,
|
||||
labelText: widget.label,
|
||||
alignLabelWithHint: true,
|
||||
labelStyle: AppFonts.yekan14
|
||||
.copyWith(color: AppColor.lightGreyDarkActive)
|
||||
.merge(widget.labelStyle),
|
||||
labelStyle: AppFonts.yekan14.copyWith(color: AppColor.lightGreyDarkActive).merge(widget.labelStyle),
|
||||
filled: widget.filled || widget._noBorder || widget._passwordNoBorder,
|
||||
fillColor: widget.filledColor,
|
||||
counter: widget.showCounter ? null : const SizedBox(),
|
||||
@@ -179,4 +165,4 @@ class _RTextFieldState extends State<RTextField> {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user