From 44100bf3d6b9872fc1f241208c07988671687a16 Mon Sep 17 00:00:00 2001 From: Shubhamshirva Date: Fri, 31 May 2024 15:17:24 +0530 Subject: [PATCH 1/2] some changes for common textformfield,dropdown,appbar and some pages changes --- lib/Common/CommonWidget.dart | 1 + .../Main_Screens/Community/PostScreen.dart | 2 +- lib/Login/View/loginscreen.dart | 21 +- lib/Utils/Common/CommonAppbar.dart | 52 +- lib/Utils/Common/CommonDropdown.dart | 19 +- lib/Utils/Common/CustomTextformfield.dart | 612 ++++++++++++------ lib/main.dart | 2 +- .../Signup/View/Business/tellusbusiness.dart | 12 +- .../View/Individual/tellusindividual.dart | 16 +- lib/onboarding/Signup/View/signupscreen.dart | 40 +- lib/onboarding/Signup/View/verifyuser.dart | 7 +- 11 files changed, 497 insertions(+), 287 deletions(-) diff --git a/lib/Common/CommonWidget.dart b/lib/Common/CommonWidget.dart index af71d28..f492e90 100644 --- a/lib/Common/CommonWidget.dart +++ b/lib/Common/CommonWidget.dart @@ -120,6 +120,7 @@ Widget MessageTextInputField( String extractFileName(String filePath) { return path.basename(filePath); +} Widget commonDivider(){ return Container( diff --git a/lib/Feed Module/Main_Screens/Community/PostScreen.dart b/lib/Feed Module/Main_Screens/Community/PostScreen.dart index 9a85cda..a18556d 100644 --- a/lib/Feed Module/Main_Screens/Community/PostScreen.dart +++ b/lib/Feed Module/Main_Screens/Community/PostScreen.dart @@ -51,7 +51,7 @@ class _PostScreenState extends State { sizedBoxHeight(20.h), text16w400_FCFCFC("Caption"), sizedBoxHeight(20.h), - const CustomTextFormField2( + CustomTextFormField2( maxlines: 3, ), sizedBoxHeight(25.h), diff --git a/lib/Login/View/loginscreen.dart b/lib/Login/View/loginscreen.dart index fef858a..eb4d896 100644 --- a/lib/Login/View/loginscreen.dart +++ b/lib/Login/View/loginscreen.dart @@ -33,18 +33,9 @@ class _LoginScreenState extends State { backgroundColor: Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - Positioned( - top: 210, - left: -30, - child: CommonBlurLeftSecond()), - Positioned( - top: 400, - right: -30, - child: CommonBlurRightSecond()), - Positioned( - top: 550, - left: -30, - child: CommonBlurLeftBlue()), + Positioned(top: 210, left: -30, child: CommonBlurLeftSecond()), + Positioned(top: 400, right: -30, child: CommonBlurRightSecond()), + Positioned(top: 550, left: -30, child: CommonBlurLeftBlue()), SingleChildScrollView( child: GlassmorphicContainer( width: MediaQuery.of(context).size.width, @@ -212,7 +203,7 @@ class _LoginScreenState extends State { height: 17.h, ), ), - validatorText: "Email Id", + // validatorText: "Email Id", validator: (value) { if (value!.isEmpty) { return 'Enter your e-mail address'; @@ -225,11 +216,11 @@ class _LoginScreenState extends State { return null; }, inputFormatters: [ - LengthLimitingTextInputFormatter(20), + LengthLimitingTextInputFormatter(30), RemoveEmojiInputFormatter() ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(10.h), text16400white('Password'), sizedBoxHeight(10.h), // Obx(() { diff --git a/lib/Utils/Common/CommonAppbar.dart b/lib/Utils/Common/CommonAppbar.dart index d7eb293..e2df61a 100644 --- a/lib/Utils/Common/CommonAppbar.dart +++ b/lib/Utils/Common/CommonAppbar.dart @@ -62,13 +62,13 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { preferredSize: Size.fromHeight(80), child: AppBar( scrolledUnderElevation: 0.0, - backgroundColor: Color(0xFF222935), + backgroundColor: Color(0xFF222935).withOpacity(0.50), elevation: 0, automaticallyImplyLeading: false, titleSpacing: 0, title: showLeading! ? Padding( - padding: EdgeInsets.symmetric(horizontal: 16.w), + padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 10.h), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Row( @@ -96,6 +96,7 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { ) : SingleChildScrollView( scrollDirection: Axis.horizontal, + padding: EdgeInsets.only(top: 10), child: Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, @@ -119,28 +120,33 @@ class CommonAppbar extends StatelessWidget implements PreferredSizeWidget { ), ), leading: showLeading! - ? InkWell( - onTap: () { - Get.back(); - }, - child: Row( - children: [ - sizedBoxWidth(10.w), - commonGlassContainer( - border: 0.9, - width: 40.w, - height: 40.h, - borderradius: 100, - customWidget: Center( - child: Icon( - Icons.arrow_back, - color: Colors.white, - size: 20.sp, + ? Padding( + padding: EdgeInsets.only(top: 10.h), + child: InkWell( + onTap: () { + Get.back(); + }, + child: Row( + children: [ + sizedBoxWidth(10.w), + commonGlassContainer( + border: 0.9, + width: 40.w, + height: 40.h, + borderradius: 100, + customWidget: Center( + child: Image.asset( + 'assets/images/png/appbararrowbutton.png') + // Icon( + // Icons.arrow_back, + // color: Colors.white, + // size: 20.sp, + // ), + ), ), - ), - ), - ], - )) + ], + )), + ) : null, actions: [ if (customActionWidget != null) diff --git a/lib/Utils/Common/CommonDropdown.dart b/lib/Utils/Common/CommonDropdown.dart index 80ef97b..67e1e48 100644 --- a/lib/Utils/Common/CommonDropdown.dart +++ b/lib/Utils/Common/CommonDropdown.dart @@ -44,7 +44,7 @@ class _CustomDropDownWidgetSignupState width: double.infinity, height: 50.h, padding: EdgeInsets.only( - top: 14.0, bottom: 14.0, right: 14.w, left: 12.w), + top: 14.0, bottom: 14.0, right: 22.w, left: 12.w), decoration: BoxDecoration( color: Color(0xFFFFFFFF).withOpacity(0.10), borderRadius: onDropTap.value @@ -52,6 +52,14 @@ class _CustomDropDownWidgetSignupState top: Radius.circular(30.r), ) : BorderRadius.circular(30.r), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), border: Border.all(color: const Color(0xFF434A53)), ), child: Row( @@ -71,6 +79,7 @@ class _CustomDropDownWidgetSignupState style: TextStyle( color: Colors.white, fontSize: 16.sp, + fontFamily: 'Helvetica', fontWeight: FontWeight.w400), ), ], @@ -91,6 +100,14 @@ class _CustomDropDownWidgetSignupState bottom: Radius.circular(30.r), ), border: Border.all(color: const Color(0xFF434A53)), + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.50), + const Color(0xFFFFFFFF).withOpacity(0.50), + ], + ), ), child: ListView.builder( shrinkWrap: true, diff --git a/lib/Utils/Common/CustomTextformfield.dart b/lib/Utils/Common/CustomTextformfield.dart index 73b4be9..4b1372d 100644 --- a/lib/Utils/Common/CustomTextformfield.dart +++ b/lib/Utils/Common/CustomTextformfield.dart @@ -7,31 +7,25 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:glassmorphism/glassmorphism.dart'; +import 'package:regroup/Utils/Common/sized_box.dart'; import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class CustomTextFormField extends StatefulWidget { - const CustomTextFormField({ + CustomTextFormField({ Key? key, this.validator, + this.validationMessage, this.textEditingController, this.hintText, this.leadingIcon, this.prefixIconColor = const Color(0xFF737373), this.isInputPassword = false, - this.validatorText, this.value, this.readonly = false, this.enabled = true, - - this.textCapital = false, - this.isInputPassword = false, this.outlineColor = Colors.black, - // this.bgColor = const Color(0xFFFFF3E4), - this.prefixIconColor = Colors.white, - this.maxlines = 1, - this.texttype, this.inputFormatters, this.onInput, @@ -39,26 +33,23 @@ class CustomTextFormField extends StatefulWidget { this.suffixIcon, }) : super(key: key); - final dynamic validator; + final String? Function(String?)? validator; final TextEditingController? textEditingController; final String? hintText; final Widget? leadingIcon; final Color prefixIconColor; final bool isInputPassword; - final String? validatorText; final String? value; final bool readonly; final bool enabled; final int maxlines; final TextInputType? texttype; - final dynamic inputFormatters; - + final List? inputFormatters; final Color outlineColor; - // final Color bgColor; - final Function(String)? onInput; final VoidCallback? onTap; final Widget? suffixIcon; + String? validationMessage; @override State createState() => _CustomTextFormFieldState(); @@ -73,113 +64,125 @@ class _CustomTextFormFieldState extends State { obscureText = widget.isInputPassword; } + void validateField(String value) { + setState(() { + widget.validationMessage = widget.validator?.call(value) ?? + (value.isEmpty ? "Empty value" : null); + }); + } + @override Widget build(BuildContext context) { - return GlassmorphicContainer( - width: double.infinity, - height: 50, - borderRadius: 30, - blur: 10, - alignment: Alignment.bottomCenter, - border: 0.8, - linearGradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - const Color(0xFFffffff).withOpacity(0.04), - const Color(0xFFFFFFFF).withOpacity(0.05), - ], - stops: [ - 0.1, - 1, - ]), - borderGradient: const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xff434A53), - Color(0xFF434A53), - ], - ), - child: TextFormField( - cursorColor: Colors.red, - initialValue: widget.value, - readOnly: widget.readonly, - onTap: widget.onTap, - enabled: widget.enabled, - enableInteractiveSelection: false, - maxLines: widget.maxlines, - autovalidateMode: AutovalidateMode.onUserInteraction, - obscureText: obscureText, - controller: widget.textEditingController, - - decoration: InputDecoration( - hintText: widget.hintText, - prefixIconColor: widget.prefixIconColor, - - hintStyle: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w400, - fontFamily: 'hiragino'), - - // ignore: prefer_null_aware_operators - prefixIcon: widget.leadingIcon == null ? null : widget.leadingIcon!, - suffixIcon: widget.isInputPassword - ? GestureDetector( - onTap: () => setState(() => obscureText = !obscureText), - child: obscureText - ? const Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(right: 20.0), - child: Icon(Icons.remove_red_eye), + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GlassmorphicContainer( + width: double.infinity, + height: 50, + borderRadius: 30, + blur: 10, + alignment: Alignment.bottomCenter, + border: 0.8, + linearGradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.04), + const Color(0xFFFFFFFF).withOpacity(0.05), + ], + stops: [ + 0.1, + 1, + ]), + borderGradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xff434A53), + Color(0xFF434A53), + ], + ), + child: TextFormField( + style: TextStyle( + fontSize: 16.sp, color: Colors.white, fontFamily: 'Helvetica'), + cursorColor: Colors.red, + initialValue: widget.value, + readOnly: widget.readonly, + onTap: widget.onTap, + enabled: widget.enabled, + enableInteractiveSelection: false, + maxLines: widget.maxlines, + obscureText: obscureText, + controller: widget.textEditingController, + decoration: InputDecoration( + hintText: widget.hintText, + prefixIconColor: widget.prefixIconColor, + constraints: BoxConstraints(minHeight: 50), + hintStyle: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w400, + fontFamily: 'Helvetica'), + prefixIcon: + widget.leadingIcon == null ? null : widget.leadingIcon!, + suffixIcon: widget.isInputPassword + ? GestureDetector( + onTap: () => setState(() => obscureText = !obscureText), + child: obscureText + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 20.0), + child: SvgPicture.asset( + "assets/images/svg/loginpasswordclose.svg", + ), + ), + ], + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 20.0), + child: SvgPicture.asset( + 'assets/images/svg/loginpasswordopen.svg', + ), + ), + ], ), - ], - ) - : const Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(right: 20.0), - child: Icon( - Icons.remove_red_eye_outlined, - color: Color(0xFF959595), - ), - ), - ], - ), - ) - : widget.suffixIcon == null - ? null - : widget.suffixIcon!, - border: InputBorder.none, - contentPadding: - const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + ) + : widget.suffixIcon == null + ? null + : widget.suffixIcon!, + border: InputBorder.none, + contentPadding: + const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + ), + keyboardType: widget.texttype, + inputFormatters: widget.inputFormatters, + onChanged: (value) { + widget.onInput?.call(value); + validateField(value); + }, + ), ), - style: const TextStyle(color: Colors.white), - keyboardType: widget.texttype, - // validator: widget.validator ?? - // (value) { - // if (value == null || value.isEmpty) { - // return "Empty value"; - // } - // return null; - // }, - inputFormatters: widget.inputFormatters, - onChanged: (value) { - widget.onInput?.call(value); - }, - ), + sizedBoxHeight(5.h), + Text( + widget.validationMessage ?? '', + style: TextStyle(color: Colors.red, fontSize: 12.sp), + overflow: TextOverflow.ellipsis, + ), + ], ); } } class CustomTextFormField2 extends StatefulWidget { - const CustomTextFormField2({ + CustomTextFormField2({ Key? key, this.validator, + this.validationMessage, this.textEditingController, this.hintText, this.leadingIcon, @@ -213,6 +216,7 @@ class CustomTextFormField2 extends StatefulWidget { final Function(String)? onInput; final VoidCallback? onTap; final Widget? suffixIcon; + String? validationMessage; @override State createState() => _CustomTextFormField2State(); @@ -227,105 +231,307 @@ class _CustomTextFormField2State extends State { obscureText = widget.isInputPassword; } + void validateField(String value) { + setState(() { + widget.validationMessage = widget.validator?.call(value) ?? + (value.isEmpty ? "Empty value" : null); + }); + } + @override Widget build(BuildContext context) { - return GlassmorphicContainer( - width: double.infinity, - height: 100.h, - borderRadius: 10, - blur: 10, - alignment: Alignment.bottomCenter, - border: 0.8, - linearGradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - const Color(0xFFffffff).withOpacity(0.04), - const Color(0xFFFFFFFF).withOpacity(0.05), - ], - stops: [ - 0.1, - 1, - ]), - borderGradient: const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color(0xff434A53), - Color(0xFF434A53), - ], - ), - child: TextFormField( - cursorColor: Colors.red, - initialValue: widget.value, - readOnly: widget.readonly, - onTap: widget.onTap, - enabled: widget.enabled, - enableInteractiveSelection: false, - maxLines: widget.maxlines, - autovalidateMode: AutovalidateMode.onUserInteraction, - obscureText: obscureText, - controller: widget.textEditingController, + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GlassmorphicContainer( + width: double.infinity, + height: 100.h, + borderRadius: 10, + blur: 10, + alignment: Alignment.bottomCenter, + border: 0.8, + linearGradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.04), + const Color(0xFFFFFFFF).withOpacity(0.05), + ], + stops: [ + 0.1, + 1, + ]), + borderGradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xff434A53), + Color(0xFF434A53), + ], + ), + child: TextFormField( + cursorColor: Colors.red, + initialValue: widget.value, + readOnly: widget.readonly, + onTap: widget.onTap, + enabled: widget.enabled, + enableInteractiveSelection: false, + maxLines: widget.maxlines, + autovalidateMode: AutovalidateMode.onUserInteraction, + obscureText: obscureText, + controller: widget.textEditingController, - decoration: InputDecoration( - hintText: widget.hintText, - prefixIconColor: widget.prefixIconColor, + decoration: InputDecoration( + hintText: widget.hintText, + prefixIconColor: widget.prefixIconColor, + constraints: BoxConstraints(minHeight: 50), - hintStyle: TextStyle( - fontSize: 16.sp, - color: Colors.white, - fontWeight: FontWeight.w400, - fontFamily: 'hiragino'), + hintStyle: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w400, + fontFamily: 'hiragino'), - // ignore: prefer_null_aware_operators - prefixIcon: widget.leadingIcon == null ? null : widget.leadingIcon!, - suffixIcon: widget.isInputPassword - ? GestureDetector( - onTap: () => setState(() => obscureText = !obscureText), - child: obscureText - ? const Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(right: 20.0), - child: Icon(Icons.remove_red_eye), + // ignore: prefer_null_aware_operators + prefixIcon: + widget.leadingIcon == null ? null : widget.leadingIcon!, + suffixIcon: widget.isInputPassword + ? GestureDetector( + onTap: () => setState(() => obscureText = !obscureText), + child: obscureText + ? const Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 20.0), + child: Icon(Icons.remove_red_eye), + ), + ], + ) + : const Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 20.0), + child: Icon( + Icons.remove_red_eye_outlined, + color: Color(0xFF959595), + ), + ), + ], ), - ], - ) - : const Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Padding( - padding: EdgeInsets.only(right: 20.0), - child: Icon( - Icons.remove_red_eye_outlined, - color: Color(0xFF959595), - ), - ), - ], - ), - ) - : widget.suffixIcon == null - ? null - : widget.suffixIcon!, - border: InputBorder.none, - contentPadding: - const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + ) + : widget.suffixIcon == null + ? null + : widget.suffixIcon!, + border: InputBorder.none, + contentPadding: + const EdgeInsets.symmetric(horizontal: 10, vertical: 10), + ), + style: const TextStyle(color: Colors.white), + keyboardType: widget.texttype, + // validator: widget.validator ?? + // (value) { + // if (value == null || value.isEmpty) { + // return "Empty value"; + // } + // return null; + // }, + inputFormatters: widget.inputFormatters, + onChanged: (value) { + widget.onInput?.call(value); + }, + ), ), - style: const TextStyle(color: Colors.white), - keyboardType: widget.texttype, - // validator: widget.validator ?? - // (value) { - // if (value == null || value.isEmpty) { - // return "Empty value"; - // } - // return null; - // }, - inputFormatters: widget.inputFormatters, - onChanged: (value) { - widget.onInput?.call(value); - }, - ), + sizedBoxHeight(5.h), + Text( + widget.validationMessage ?? '', + style: TextStyle(color: Colors.red, fontSize: 12.sp), + overflow: TextOverflow.ellipsis, + ), + ], + ); + } +} + +class CustomTextFormFieldPassword extends StatefulWidget { + CustomTextFormFieldPassword({ + Key? key, + this.validator, + this.validationMessage, + this.inputFormatters, + this.hintText, + this.validatorText, + this.value, + this.textEditingController, + this.leadingIcon, + this.readonly = false, + this.enabled = true, + this.textCapital = false, + this.isInputPassword = false, + this.outlineColor = Colors.black, + this.prefixIconColor = Colors.white, + this.texttype, + this.onInput, + this.onTap, + this.maxlines = 1, + }) : super(key: key); + + final String? Function(String?)? validator; + final TextEditingController? textEditingController; + final String? hintText; + final String? validatorText; + final String? value; + final Widget? leadingIcon; + final bool isInputPassword; + final bool readonly; + final bool enabled; + final bool textCapital; + final List? inputFormatters; + final Color outlineColor; + final Color prefixIconColor; + final TextInputType? texttype; + final Function(String)? onInput; + final VoidCallback? onTap; + final int maxlines; + String? validationMessage; + + @override + State createState() => + _CustomtextFormFieldPasswordState(); +} + +class _CustomtextFormFieldPasswordState + extends State { + late bool obscureText; + var emojiFormatter = RemoveEmojiInputFormatter(); + + @override + void initState() { + super.initState(); + obscureText = widget.isInputPassword; + } + + void validateField(String value) { + setState(() { + widget.validationMessage = widget.validator?.call(value) ?? + (value.isEmpty ? "Empty value" : null); + }); + } + + @override + Widget build(BuildContext context) { + List allFormatters = [emojiFormatter]; + if (widget.inputFormatters != null) { + allFormatters.addAll(widget.inputFormatters!); + } + + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + GlassmorphicContainer( + width: double.infinity, + height: 50, + borderRadius: 30, + blur: 10, + alignment: Alignment.bottomCenter, + border: 0.8, + linearGradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + const Color(0xFFffffff).withOpacity(0.04), + const Color(0xFFFFFFFF).withOpacity(0.05), + ], + stops: [0.1, 1], + ), + borderGradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + Color(0xff434A53), + Color(0xFF434A53), + ], + ), + child: TextFormField( + textCapitalization: widget.textCapital + ? TextCapitalization.characters + : TextCapitalization.none, + onTap: widget.onTap, + style: TextStyle( + fontSize: 16.sp, color: Colors.white, fontFamily: 'Helvetica'), + initialValue: widget.value, + readOnly: widget.readonly, + enabled: widget.enabled, + maxLines: widget.maxlines, + cursorColor: Colors.white, + obscureText: obscureText, + controller: widget.textEditingController, + decoration: InputDecoration( + hintStyle: TextStyle( + fontSize: 16.sp, + color: Colors.white, + fontWeight: FontWeight.w400, + fontFamily: 'Helvetica'), + labelStyle: const TextStyle(color: Colors.white), + errorStyle: TextStyle( + fontSize: 13.sp, + color: Color.fromARGB(255, 245, 130, 122), + ), + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 0), + filled: true, + fillColor: + Colors.transparent, // Make sure fillColor is transparent + border: InputBorder.none, + hintText: widget.hintText, + prefixIconColor: widget.prefixIconColor, + prefixIcon: + widget.leadingIcon == null ? null : widget.leadingIcon!, + suffixIcon: widget.isInputPassword + ? GestureDetector( + onTap: () => setState(() => obscureText = !obscureText), + child: obscureText + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 20.0), + child: SvgPicture.asset( + "assets/images/svg/loginpasswordclose.svg", + ), + ), + ], + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.only(right: 20.0), + child: SvgPicture.asset( + 'assets/images/svg/loginpasswordopen.svg', + ), + ), + ], + ), + ) + : null, + ), + keyboardType: widget.texttype, + inputFormatters: allFormatters, + onChanged: (value) { + widget.onInput?.call(value); + validateField(value); + }, + validator: widget.validator, + ), + ), + sizedBoxHeight(5.h), + Text( + widget.validationMessage ?? '', + style: TextStyle(color: Colors.red, fontSize: 12.sp), + overflow: TextOverflow.ellipsis, + ), + ], ); } } diff --git a/lib/main.dart b/lib/main.dart index 1a897bc..16aff1c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -206,7 +206,7 @@ class _MyAppState extends State with WidgetsBindingObserver { fontFamily: 'Cambria', ), debugShowCheckedModeBanner: false, - initialRoute: RouteName.mainscreen, + initialRoute: RouteName.splashScreen, //initialRoute: RouteName.mainScreen, getPages: AppRoutes.appRoutes(), diff --git a/lib/onboarding/Signup/View/Business/tellusbusiness.dart b/lib/onboarding/Signup/View/Business/tellusbusiness.dart index 042b9a1..c7c0dca 100644 --- a/lib/onboarding/Signup/View/Business/tellusbusiness.dart +++ b/lib/onboarding/Signup/View/Business/tellusbusiness.dart @@ -124,7 +124,7 @@ class _TellusaboutBusinessState extends State { height: 17.h, 'assets/images/png/user.png', ), - validatorText: "Enter your business owner name", + // validatorText: "Enter your business owner name", validator: (value) { if (value!.isEmpty) { return 'Enter your business owner name '; @@ -138,7 +138,7 @@ class _TellusaboutBusinessState extends State { RegExp('[a-zA-Z ]')) ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(10.h), text16400white('Business name'), sizedBoxHeight(10.h), CustomTextFormField( @@ -152,7 +152,7 @@ class _TellusaboutBusinessState extends State { height: 17.h, 'assets/images/png/briefcase.png', ), - validatorText: "Enter your business name", + // validatorText: "Enter your business name", validator: (value) { if (value!.isEmpty) { return 'Enter your business name '; @@ -166,7 +166,7 @@ class _TellusaboutBusinessState extends State { RegExp('[a-zA-Z ]')) ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(10.h), text16400white('Business location'), sizedBoxHeight(10.h), CustomTextFormField( @@ -180,7 +180,7 @@ class _TellusaboutBusinessState extends State { height: 17.h, 'assets/images/png/location.png', ), - validatorText: "Enter your business location", + // validatorText: "Enter your business location", validator: (value) { if (value!.isEmpty) { return 'Enter your business location '; @@ -194,7 +194,7 @@ class _TellusaboutBusinessState extends State { RegExp('[a-zA-Z ]')) ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(10.h), text16400white('Type of business'), sizedBoxHeight(10.h), CustomDropDownWidgetSignup( diff --git a/lib/onboarding/Signup/View/Individual/tellusindividual.dart b/lib/onboarding/Signup/View/Individual/tellusindividual.dart index 810436d..6a391b1 100644 --- a/lib/onboarding/Signup/View/Individual/tellusindividual.dart +++ b/lib/onboarding/Signup/View/Individual/tellusindividual.dart @@ -289,7 +289,7 @@ class _TellusaboutIndividualState extends State { height: 17.h, 'assets/images/png/user.png', ), - validatorText: "Enter your full name", + // validatorText: "Enter your full name", validator: (value) { if (value!.isEmpty) { return 'Enter your full name '; @@ -303,7 +303,7 @@ class _TellusaboutIndividualState extends State { RegExp('[a-zA-Z ]')) ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(0.h), text16400white('User name'), sizedBoxHeight(10.h), CustomTextFormField( @@ -317,7 +317,7 @@ class _TellusaboutIndividualState extends State { height: 17.h, 'assets/images/png/user.png', ), - validatorText: "Enter your user name", + // validatorText: "Enter your user name", validator: (value) { if (value!.isEmpty) { return 'Enter your user name '; @@ -331,7 +331,7 @@ class _TellusaboutIndividualState extends State { RegExp('[a-zA-Z ]')) ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(0.h), text16400white('Date of birth'), sizedBoxHeight(10.h), CustomTextFormField( @@ -349,7 +349,7 @@ class _TellusaboutIndividualState extends State { height: 17.h, 'assets/images/png/dateimage.png', ), - validatorText: "Enter date of birth", + // validatorText: "Enter date of birth", validator: (value) { if (value!.isEmpty) { return 'Enter your date of birth'; @@ -357,7 +357,7 @@ class _TellusaboutIndividualState extends State { return null; }, ), - sizedBoxHeight(20.h), + sizedBoxHeight(0.h), text16400white('Gender'), sizedBoxHeight(10.h), CustomDropDownWidgetSignup( @@ -388,7 +388,7 @@ class _TellusaboutIndividualState extends State { height: 17.h, 'assets/images/png/location.png', ), - validatorText: "Enter your location", + // validatorText: "Enter your location", validator: (value) { if (value!.isEmpty) { return 'Enter your location '; @@ -402,7 +402,7 @@ class _TellusaboutIndividualState extends State { RegExp('[a-zA-Z ]')) ], ), - sizedBoxHeight(30.h), + sizedBoxHeight(20.h), CustomButton( text: "Continue", onPressed: () { diff --git a/lib/onboarding/Signup/View/signupscreen.dart b/lib/onboarding/Signup/View/signupscreen.dart index 3db6e83..f9271f2 100644 --- a/lib/onboarding/Signup/View/signupscreen.dart +++ b/lib/onboarding/Signup/View/signupscreen.dart @@ -44,18 +44,9 @@ class _SignupScreenState extends State { backgroundColor: Color.fromARGB(255, 18, 32, 47), body: Stack( children: [ - Positioned( - top: 210, - left: -30, - child: CommonBlurLeftSecond()), - Positioned( - top: 400, - right: -30, - child: CommonBlurRightSecond()), - Positioned( - top: 550, - left: -30, - child: CommonBlurLeftBlue()), + Positioned(top: 210, left: -30, child: CommonBlurLeftSecond()), + Positioned(top: 400, right: -30, child: CommonBlurRightSecond()), + Positioned(top: 550, left: -30, child: CommonBlurLeftBlue()), GlassmorphicContainer( width: MediaQuery.of(context).size.width, height: @@ -135,7 +126,7 @@ class _SignupScreenState extends State { height: 17.h, ), ), - validatorText: "Email Id", + // validatorText: "Email Id", validator: (value) { if (value!.isEmpty) { return 'Enter your e-mail address'; @@ -152,7 +143,7 @@ class _SignupScreenState extends State { RemoveEmojiInputFormatter() ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(10.h), text16400white('Password'), sizedBoxHeight(10.h), CustomTextFormFieldPassword( @@ -177,7 +168,7 @@ class _SignupScreenState extends State { RemoveEmojiInputFormatter() ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(10.h), text16400white('Confirm password'), sizedBoxHeight(10.h), CustomTextFormField( @@ -190,7 +181,7 @@ class _SignupScreenState extends State { height: 17.h, ), // const Icon(Icons.lock_outline), - validatorText: "Enter your password", + // validatorText: "Enter your password", validator: (val) { if (val == null || val.isEmpty) { return 'Please enter your password'; @@ -205,7 +196,7 @@ class _SignupScreenState extends State { RemoveEmojiInputFormatter() ], ), - sizedBoxHeight(20.h), + sizedBoxHeight(10.h), Row( children: [ text16400white('Account type'), @@ -220,10 +211,9 @@ class _SignupScreenState extends State { title: '', listData: _dropdownProductItems, onItemSelected: _onItemSelected, - leadingImage: - Image.asset( - 'assets/images/png/user.png', - ), + leadingImage: Image.asset( + 'assets/images/png/user.png', + ), ), sizedBoxHeight(30.h), Row( @@ -295,14 +285,12 @@ class _SignupScreenState extends State { // Get.to(() => IndividualPage()); print('individual selected'); Get.toNamed(RouteName.verifyusercreen, - arguments: _selectedAccountType - ); + arguments: _selectedAccountType); } else if (_selectedAccountType == 'Business') { print('business selected'); - Get.toNamed(RouteName.verifyusercreen, - arguments: _selectedAccountType - ); + Get.toNamed(RouteName.verifyusercreen, + arguments: _selectedAccountType); // Get.to(() => BusinessPage()); } else { diff --git a/lib/onboarding/Signup/View/verifyuser.dart b/lib/onboarding/Signup/View/verifyuser.dart index 7f51a2e..5ee39c6 100644 --- a/lib/onboarding/Signup/View/verifyuser.dart +++ b/lib/onboarding/Signup/View/verifyuser.dart @@ -27,9 +27,9 @@ class _VerifyuserScreenStateState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: Color.fromARGB(255, 18, 32, 47), - // appBar: CommonAppbar( - // titleTxt: '', - // ), + appBar: CommonAppbar( + titleTxt: '', + ), body: Stack( children: [ // CommonBlurLeftSecond(), @@ -76,6 +76,7 @@ class _VerifyuserScreenStateState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ + sizedBoxHeight(20.h), text22400white('Check your email'), sizedBoxHeight(10.h), text14400white( From e961cea973b46de59b9c26d6d31d220445832076 Mon Sep 17 00:00:00 2001 From: Shubhamshirva Date: Fri, 31 May 2024 15:26:02 +0530 Subject: [PATCH 2/2] resolved some minor issues --- lib/Common/CommonWidget.dart | 22 ------------------- .../Main_Screens/Community/PostScreen.dart | 2 +- lib/Utils/Common/CustomTextformfield.dart | 3 +++ 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/lib/Common/CommonWidget.dart b/lib/Common/CommonWidget.dart index f40bf49..f677ead 100644 --- a/lib/Common/CommonWidget.dart +++ b/lib/Common/CommonWidget.dart @@ -140,24 +140,6 @@ String extractFileName(String filePath) { return path.basename(filePath); } -Widget commonDivider(){ - return Container( - height: 1.5.h, - width: double.infinity, - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ - Color.fromRGBO(255, 255, 255, 0.07), - Color.fromRGBO(255, 255, 255, 0.09), - ], - transform: GradientRotation(1.78), - ), - ), - ); - -} Widget stackContainers({ required String number, @@ -243,7 +225,3 @@ Widget popupMenuItemWidget({ ), ); } - -String extractFileName(String filePath) { - return path.basename(filePath); -} diff --git a/lib/Feed Module/Main_Screens/Community/PostScreen.dart b/lib/Feed Module/Main_Screens/Community/PostScreen.dart index cc1492b..2cba896 100644 --- a/lib/Feed Module/Main_Screens/Community/PostScreen.dart +++ b/lib/Feed Module/Main_Screens/Community/PostScreen.dart @@ -52,7 +52,7 @@ class _PostScreenState extends State { text16w400_FCFCFC("Caption"), sizedBoxHeight(18.h), - const CustomTextFormField2( + CustomTextFormField2( maxlines: 3, ), sizedBoxHeight(25.h), diff --git a/lib/Utils/Common/CustomTextformfield.dart b/lib/Utils/Common/CustomTextformfield.dart index 93aa670..7539624 100644 --- a/lib/Utils/Common/CustomTextformfield.dart +++ b/lib/Utils/Common/CustomTextformfield.dart @@ -1,11 +1,14 @@ // ignore_for_file: must_be_immutable import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_svg/flutter_svg.dart'; import 'package:glassmorphism/glassmorphism.dart'; import 'package:regroup/Utils/Common/sized_box.dart'; +import 'package:remove_emoji_input_formatter/remove_emoji_input_formatter.dart'; class CustomTextFormField extends StatefulWidget {