From 29df82bb2c6ec9778c8ce2d3a0fb42a2ea2e8ec4 Mon Sep 17 00:00:00 2001 From: Ashish Sharma Date: Tue, 20 Feb 2024 12:28:16 +0530 Subject: [PATCH] created support text for input fields --- README.md | 3 +++ lib/common_widgets.dart | 15 +++++++++++++++ lib/signup_screen.dart | 11 +++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 50da4fc..5e1b0f5 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,9 @@ More details at [kilvish.in](https://kilvish.in) - Due to sharing related changes, android & iOS specific code is written which had broken the web or MacOS builds. - `flutter build apk --debug && flutter install --debug` will build & install apk in an already running emulator - To run an Android emulator, install Android Studio & launch an emulator with the AVD manager + - To make it easier to launch emulator every time, add `/path/to/sdk/emulator` to PATH variable & run command `emulator -avd ` + - you can find SDK path from Android Studio -> Settings -> Appearance & Behavior -> Android SDK + - To give a short name to the emulator, launch AVD manager from Android Studio, click on the pencil/edit button of the emulator & give it a short name that you can pass to the emulator command above. ## Firebase Setup diff --git a/lib/common_widgets.dart b/lib/common_widgets.dart index f39d964..e98b4a9 100644 --- a/lib/common_widgets.dart +++ b/lib/common_widgets.dart @@ -115,6 +115,21 @@ Widget renderLabel( ))); } +Widget renderSupportLabel( + {required String text, + Color color = inactiveColor, + double fontSize = smallFontSize, + double topSpacing = 0}) { + return Container( + margin: EdgeInsets.only(top: topSpacing), + child: Align( + alignment: Alignment.centerLeft, + child: Text( + text, + style: TextStyle(color: color, fontSize: fontSize), + ))); +} + Widget renderHelperText({required String text}) { return Container( margin: const EdgeInsets.only(top: 5, bottom: 10), diff --git a/lib/signup_screen.dart b/lib/signup_screen.dart index 8aedef6..ac5cfef 100644 --- a/lib/signup_screen.dart +++ b/lib/signup_screen.dart @@ -156,7 +156,8 @@ class SignUpPageState extends State { SignupForm( stepNumber: "1", fieldLabel: "Kilvish Id", - hint: "First time user ? Create a new kilvish id", + supportLabel: "First time user ? Get a new id", + hint: "crime-master-gogo", isActive: _stepNumber == 1 && (!sendOtpSuccess), isOperationAllowedButNotActive: _stepNumber > 1, buttonClickHandler: () => allowFormSubmission(1), @@ -166,6 +167,7 @@ class SignUpPageState extends State { SignupForm( stepNumber: "2", fieldLabel: "Phone Number", + supportLabel: "OTP will be sent on this number", hint: "7019316063", isActive: _stepNumber == 2 && (!sendOtpSuccess), isOperationAllowedButNotActive: _stepNumber > 2, @@ -177,10 +179,12 @@ class SignUpPageState extends State { SignupForm( stepNumber: "3", fieldLabel: "Email Id", + supportLabel: + "In future, you can receive OTP either on email or on phone", buttonLabel: sendOtpSuccess ? (isOtpButtonEnabled ? "Re-requet OTP" : "Please wait ..") : "Get OTP", - hint: "admin@mail.com", + hint: "teja-finder@aaa.movie", isActive: _stepNumber == 3 && (!sendOtpSuccess), isOperationAllowedButNotActive: _stepNumber > 3, buttonClickHandler: () { @@ -369,6 +373,7 @@ String? genericFieldValidator(String? value) { class SignupForm extends StatefulWidget { final String stepNumber; final String fieldLabel; + final String supportLabel; final String? buttonLabel; final String hint; final bool isActive; @@ -384,6 +389,7 @@ class SignupForm extends StatefulWidget { const SignupForm({ required this.stepNumber, required this.fieldLabel, + required this.supportLabel, this.buttonLabel, required this.hint, required this.isActive, @@ -416,6 +422,7 @@ class SignupFormState extends State { child: Column( children: [ renderInputLabel(), + renderSupportLabel(text: widget.supportLabel), renderTextField(), Visibility( visible: widget.buttonVisible,