merge-update-with-lab-changes
Aamir Muhammad 4 months ago committed by haroon amjad
parent 462b5df7f9
commit 3c7c738b12

@ -1,3 +1,5 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:google_fonts/google_fonts.dart';
@ -53,6 +55,8 @@ class _GenericBottomSheetState extends State<GenericBottomSheet> {
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
bottom: Platform.isIOS ? false : true,
child: GestureDetector(
onTap: () {
FocusScope.of(context).unfocus(); // Dismiss the keyboard when tapping outside

@ -924,7 +924,7 @@ class _RegisterNew extends State<RegisterNew> {
type: type,
skipRegistration: skipRegistration,
onWrongActivationCode: (String? message, bool? isReroute) {
if (isReroute== true) {
if (isReroute == true) {
context.showBottomSheet(
child: ExceptionBottomSheet(
message: message.toString(),
@ -935,6 +935,7 @@ class _RegisterNew extends State<RegisterNew> {
),
);
} else {
smsOtp.clearOTPInput();
context.showBottomSheet(
child: ExceptionBottomSheet(
message: message.toString(),

@ -341,17 +341,15 @@ class _WelcomeLogin extends State<WelcomeLogin> {
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: err,
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).push(FadePage(page: RegisterNew())),
context.showBottomSheet(
child: ExceptionBottomSheet(
message: err.toString(),
showCancel: true,
onOkPressed: () {
Navigator.of(context).pop();
Navigator.of(context).push(FadePage(page: RegisterNew()));
},
cancelFunction: () => {});
dialog.showAlertDialog(context);
));
projectViewModel.analytics.loginRegistration.login_fail(error: err.toString());
});
}
@ -508,7 +506,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
checkActivationCode(
value: code,
onWrongActivationCode: (String? message) {
// smsOtp.pauseTimer();
smsOtp.clearOTPInput(); // Clear the SMS code when wrong
context.showBottomSheet(
child: ExceptionBottomSheet(
message: message.toString(),
@ -637,13 +635,13 @@ class _WelcomeLogin extends State<WelcomeLogin> {
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
context.showBottomSheet(
child: ExceptionBottomSheet(
message: err.toString(),
onOkPressed: () {
Navigator.of(context).pop();
},
));
// context.showBottomSheet(
// child: ExceptionBottomSheet(
// message: err.toString(),
// onOkPressed: () {
// Navigator.of(context).pop();
// },
// ));
// print(err);
});
} else {
@ -679,13 +677,13 @@ class _WelcomeLogin extends State<WelcomeLogin> {
}
insertIMEI();
}).catchError((error) {
context.showBottomSheet(
child: ExceptionBottomSheet(
message: error.toString(),
onOkPressed: () {
Navigator.of(context).pop();
},
));
// context.showBottomSheet(
// child: ExceptionBottomSheet(
// message: error.toString(),
// onOkPressed: () {
// Navigator.of(context).pop();
// },
// ));
});
}
@ -705,13 +703,13 @@ class _WelcomeLogin extends State<WelcomeLogin> {
insertIMEI() {
authService.insertDeviceImei(selectedOption).then((value) => {}).catchError((err) {
context.showBottomSheet(
child: ExceptionBottomSheet(
message: err.toString(),
onOkPressed: () {
Navigator.of(context).pop();
},
));
// context.showBottomSheet(
// child: ExceptionBottomSheet(
// message: err.toString(),
// onOkPressed: () {
// Navigator.of(context).pop();
// },
// ));
// print(err);
});
}

@ -136,7 +136,7 @@ class SMSOTP {
child: OTPWidget(
autoFocus: true,
controller: _pinPutController,
defaultBorderColor: Color(0xffffffff),
defaultBorderColor: Color(0xffE0E0E0), // Changed from white to light gray
maxLength: 4,
onTextChanged: (text) {},
pinBoxColor: Colors.white,
@ -315,6 +315,15 @@ class SMSOTP {
return remainingTime;
}
// Method to clear the OTP input
void clearOTPInput() {
_pinPutController.clear();
digit1.clear();
digit2.clear();
digit3.clear();
digit4.clear();
}
checkSignature() async {
SmsVerification.startListeningSms().then((message) {
// setState(() {

@ -318,13 +318,13 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
// }
Widget _buildPinCode(int i, BuildContext context) {
final bool isFilled = i < text.length;
final bool isFilled = i < text.length && strList[i].isNotEmpty; // Check both conditions
final bool isCurrent = i == currentIndex;
final bool isFocused = hasFocus && isCurrent;
// Colors based on state
Color bgColor = Colors.white;
Color borderColor = widget.defaultBorderColor;
Color borderColor = Colors.white;
Color textColor = Colors.black;
if (widget.hasError) {
@ -333,12 +333,13 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
} else if (isFocused) {
borderColor = Colors.transparent;
bgColor = Colors.white;
textColor = Colors.white;
textColor = Colors.black; // Changed from white to black for better visibility
} else if (isFilled) {
borderColor = Colors.green;
bgColor = Colors.green;
textColor = Colors.white;
}
// When cleared/empty, colors remain as default initialized above
return Container(
key: ValueKey<String>("container$i"),
@ -448,7 +449,7 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
softWrap: true,
key: ValueKey<String>("$text$i"),
style: widget.pinTextStyle?.copyWith(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily) ??
TextStyle(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily, ),
TextStyle(color: textColor, fontSize: fontSize, fontWeight: fontWeight, fontFamily: context.fontFamily,),
),
);
} else {
@ -461,6 +462,7 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
);
}
}
}
//
// Widget _animatedTextBox(String text, int i, Color textColor) {
@ -483,5 +485,4 @@ class OTPWidgetState extends State<OTPWidget> with SingleTickerProviderStateMixi
// TextStyle(color: textColor, fontSize: 24, fontWeight: FontWeight.bold),
// );
// }
// }
}
// }}

@ -91,7 +91,6 @@ class _QuickLoginBottomSheet extends State<QuickLoginBottomSheet> {
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(child:
CustomButton(
text:TranslationBase.of(context).enableQuickLogin,
onPressed:widget.onPressed,

Loading…
Cancel
Save