diff --git a/lib/controllers/auth_module/sing_in_screen_controller.dart b/lib/controllers/auth_module/sing_in_screen_controller.dart index 69b34d5..8603a3e 100644 --- a/lib/controllers/auth_module/sing_in_screen_controller.dart +++ b/lib/controllers/auth_module/sing_in_screen_controller.dart @@ -4,23 +4,26 @@ import 'package:get/get.dart'; class SignInScreenController extends GetxController { final GlobalKey screenKey = GlobalKey(); + // final emailController = TextEditingController(text: ""); // final passwordController = TextEditingController(text: ""); - final emailController = TextEditingController(text: "ashu@gmail.com"); - final passwordController = TextEditingController(text: "Abc@1234"); + final emailController = TextEditingController(text: "jack.davis@gmail.com"); + final passwordController = TextEditingController(text: "abc@1234"); final emailErrorMsg = "".obs, passwordErrorMsg = "".obs; + // final isRememberMe = false.obs; final isLoading = false.obs; + final obsecure = true.obs; @override void onInit() { - emailController.text = - LocalStorageManager.getSessionToken(tokenKey: LocalStorageKeys.kSaveEmailKey); + emailController.text = LocalStorageManager.getSessionToken( + tokenKey: LocalStorageKeys.kSaveEmailKey); // isRememberMe.value = _sessionManagement // .getSessionToken(tokenKey: SessionKeys.kRememberMeKey) // .toLowerCase() == // "true"; - emailController.text = 'ashu@gmail.com'; + emailController.text = 'jack.davis@gmail.com'; super.onInit(); } diff --git a/lib/view/custom_widgets/custom_text_field_widget.dart b/lib/view/custom_widgets/custom_text_field_widget.dart index c29365c..85e3000 100644 --- a/lib/view/custom_widgets/custom_text_field_widget.dart +++ b/lib/view/custom_widgets/custom_text_field_widget.dart @@ -12,8 +12,10 @@ class CustomTextFieldWidget extends StatelessWidget { final ValueChanged? onChange; final bool isEnabled; final bool isObscure; + final Widget? suffix; final BorderRadius? borderRadius; final Color? borderColor; + final Color? disabledColor; final double? borderWidth; final Widget? bottomChild; final TextInputType? inputType; @@ -33,17 +35,21 @@ class CustomTextFieldWidget extends StatelessWidget { this.isObscure = false, this.borderRadius, this.borderColor, + this.disabledColor, this.borderWidth = 1.0, this.bottomChild, this.textCapitalization, this.inputType, - this.inputFormatters, + this.inputFormatters, this.suffix, }); @override Widget build(BuildContext context) { return Container( decoration: BoxDecoration( + color: isEnabled + ? Colors.white + : disabledColor ?? CustomAppColors.kSmokeColor.withOpacity(0.5), borderRadius: borderRadius, border: Border.all( color: borderColor ?? CustomAppColors.kSmokeColor, @@ -54,75 +60,74 @@ class CustomTextFieldWidget extends StatelessWidget { vertical: 10.h, horizontal: 15.w, ), - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, + child: Row( children: [ - // CustomTextWidget( - // text: heading, - // fontSize: 10.sp, - // fontWeight: FontWeight.w500, - // fontColor: CustomAppColors.kLightTextColor, - // alignment: Alignment.centerLeft, - // textAlign: TextAlign.left, - // ), - Text( - heading, - textAlign: TextAlign.left, - style: TextStyle( - fontSize: 10.sp, - fontWeight: FontWeight.w500, - color: CustomAppColors.kLightTextColor, + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + heading, + textAlign: TextAlign.left, + style: TextStyle( + fontSize: 12.sp, + fontWeight: FontWeight.w500, + color: CustomAppColors.kLightTextColor, + ), + ), + 4.verticalSpace, + TextField( + controller: controller, + enabled: isEnabled, + obscureText: isObscure, + minLines: minLines, + maxLines: maxLines, + maxLength: maxLength, + inputFormatters: inputFormatters, + onChanged: (_) { + if (onChange != null) { + onChange!(_); + } + }, + keyboardType: inputType, + textCapitalization: textCapitalization ?? TextCapitalization.none, + cursorColor: CustomAppColors.kSecondaryColor, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14.sp, + color: CustomAppColors.kIconColor, + ), + decoration: InputDecoration( + isDense: true, + hintText: hintText, + hintStyle: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14.sp, + color: CustomAppColors.kLightTextColor, + ), + counterText: "", + contentPadding: EdgeInsets.zero, + border: const OutlineInputBorder( + borderSide: BorderSide.none, + ), + focusedBorder: const OutlineInputBorder( + borderSide: BorderSide.none, + ), + disabledBorder: const OutlineInputBorder( + borderSide: BorderSide.none, + ), + enabledBorder: const OutlineInputBorder( + borderSide: BorderSide.none, + ), + ), + ), + if (bottomChild != null) bottomChild!, + ], ), ), - 4.verticalSpace, - TextField( - controller: controller, - enabled: isEnabled, - obscureText: isObscure, - minLines: minLines, - maxLines: maxLines, - maxLength: maxLength, - inputFormatters: inputFormatters, - onChanged: (_) { - if (onChange != null) { - onChange!(_); - } - }, - keyboardType: inputType, - textCapitalization: textCapitalization ?? TextCapitalization.none, - cursorColor: CustomAppColors.kSecondaryColor, - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 14.sp, - color: CustomAppColors.kIconColor, - ), - decoration: InputDecoration( - isDense: true, - hintText: hintText, - hintStyle: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 14.sp, - color: CustomAppColors.kLightTextColor, - ), - counterText: "", - contentPadding: EdgeInsets.zero, - border: const OutlineInputBorder( - borderSide: BorderSide.none, - ), - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide.none, - ), - disabledBorder: const OutlineInputBorder( - borderSide: BorderSide.none, - ), - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide.none, - ), - ), - ), - if (bottomChild != null) bottomChild!, + suffix ?? const SizedBox.shrink(), ], ), ); diff --git a/lib/view/screens/auth_module/sign_in_screen.dart b/lib/view/screens/auth_module/sign_in_screen.dart index e81e522..173eac5 100644 --- a/lib/view/screens/auth_module/sign_in_screen.dart +++ b/lib/view/screens/auth_module/sign_in_screen.dart @@ -1,3 +1,4 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:ftc_mobile_app/ftc_mobile_app.dart'; import 'package:get/get.dart'; @@ -36,52 +37,62 @@ class _SignInScreenState extends State { height: 132.h, width: 203.w, ), - CustomTextWidget( text: ConstantText.kWelcomeBack, fontColor: CustomAppColors.kIconColor, fontWeight: FontWeight.w700, fontSize: 24.sp, ), - CustomTextWidget( text: ConstantText.kPleaseLoginToContinue, fontColor: CustomAppColors.kIconColor, fontWeight: FontWeight.w400, fontSize: 14.sp, ), - Padding( padding: EdgeInsets.only(top: 30.0.h), child: CustomTextFieldWidget( controller: _controller.emailController, hintText: ConstantText.kPleaseInputEmail, heading: ConstantText.kEmailHeading, - onChange: (_){ + onChange: (_) { _controller.validateEmail(); }, ), ), - Obx((){ + Obx(() { return CustomErrorMsg( message: _controller.emailErrorMsg.value, ); }), - Padding( padding: EdgeInsets.only(top: 15.0.h), - child: CustomTextFieldWidget( - controller: _controller.passwordController, - hintText: "******", - heading: ConstantText.kPasswordHeading, - onChange: (_){ - _controller.validatePassword(); - }, - isObscure: true, - maxLines: 1, - ), + child: Obx(() { + return CustomTextFieldWidget( + controller: _controller.passwordController, + hintText: "******", + heading: ConstantText.kPasswordHeading, + onChange: (_) { + _controller.validatePassword(); + }, + isObscure: _controller.obsecure(), + maxLines: 1, + suffix: IconButton( + onPressed: _controller.obsecure.toggle, + icon: Icon( + _controller.obsecure.isTrue + ? CupertinoIcons.eye_slash + : CupertinoIcons.eye, + color: _controller.obsecure.isTrue + ? CustomAppColors.kLightGreyColor + : Get.theme.colorScheme.primary, + size: 24.r, + ), + ), + ); + }), ), - Obx((){ + Obx(() { return CustomErrorMsg( message: _controller.passwordErrorMsg.value, ); @@ -110,7 +121,7 @@ class _SignInScreenState extends State { GestureDetector( onTap: _controller.onForgotButton, child: CustomTextWidget( - text: ConstantText.kForgotPassword, + text: ConstantText.kForgotPassword, isExpanded: false, fontSize: 12.sp, fontWeight: FontWeight.w500, @@ -119,14 +130,13 @@ class _SignInScreenState extends State { ], ), ), - Padding( padding: EdgeInsets.only(bottom: 8.0.h), - child: Obx((){ + child: Obx(() { return CustomAppButton( isLoading: _controller.isLoading.value, buttonText: ConstantText.kLogIn.toUpperCase(), - onTap: _controller.onLogInButton, + onTap: _controller.onLogInButton, ); }), ), @@ -151,7 +161,6 @@ class _SignInScreenState extends State { ); } - @override void dispose() { _controller.dispose(); diff --git a/lib/view/screens/clients/client_profile_screen.dart b/lib/view/screens/clients/client_profile_screen.dart index 5e919da..d1d72bc 100644 --- a/lib/view/screens/clients/client_profile_screen.dart +++ b/lib/view/screens/clients/client_profile_screen.dart @@ -33,31 +33,31 @@ class _ClientProfileScreenState extends State { screenKey: controller.screenKey, onScreenTap: controller.removeFocus, showAppBar: false, - appBar: CustomAppBar( - leadingButton: Container(), - showBoxShadow: false, - titleWidget: Row( - children: [ - InkWell( - onTap: () => controller.backButtonPressed(context), - child: CustomImageWidget( - imagePath: AssetsManager.kBackIcon, - height: 11.53.h, - width: 8.66.w, - ), - ), - const SizedBox( - width: 15, - ), - CustomTextWidget( - text: 'Client: ${controller.serviceUser()?.displayName ?? ""}', - isExpanded: false, - fontSize: 16.sp, - fontWeight: FontWeight.w700, - fontColor: CustomAppColors.kDarkBlueTextColor), - ], - ), - ), + // appBar: CustomAppBar( + // leadingButton: Container(), + // showBoxShadow: false, + // titleWidget: Row( + // children: [ + // InkWell( + // onTap: () => controller.backButtonPressed(context), + // child: CustomImageWidget( + // imagePath: AssetsManager.kBackIcon, + // height: 11.53.h, + // width: 8.66.w, + // ), + // ), + // const SizedBox( + // width: 15, + // ), + // CustomTextWidget( + // text: 'Client: ${controller.serviceUser()?.displayName ?? ""}', + // isExpanded: false, + // fontSize: 16.sp, + // fontWeight: FontWeight.w700, + // fontColor: CustomAppColors.kDarkBlueTextColor), + // ], + // ), + // ), body: Obx(() { if (controller.serviceUser() == null) { return FrequentFunctions.centerText(text: "User detail not found"); @@ -84,6 +84,11 @@ class _ClientProfileScreenState extends State { text: detail.displayName, fontSize: 14.sp, fontWeight: FontWeight.w600), + CustomTextWidget( + text: detail.email ?? "", + fontSize: 12.sp, + fontColor: Colors.grey, + fontWeight: FontWeight.w400), 16.verticalSpace, BuildDetailRow( title: 'Contact Number', diff --git a/lib/web_services/client_services.dart b/lib/web_services/client_services.dart index ee6b7cb..bb5d822 100644 --- a/lib/web_services/client_services.dart +++ b/lib/web_services/client_services.dart @@ -18,7 +18,6 @@ import '../models/clients/HealthIssuesDetailsModel.dart'; import '../models/clients/allClientsList/AllClientsResponse.dart'; import '../models/clients/documents_list_model.dart'; import '../models/create_care_plan_request.dart'; -import '../models/profile_screen_model.dart'; class ClientService { static final ClientService _instance = ClientService._private();