Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom stepper implementation and UI for General information screen done #8

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions lib/common/widget/shared/input_text_field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class InputTextField extends StatefulWidget {
final FormFieldValidator<String>? onVaildate;
final Function(String)? onTextChange;
final List<TextInputFormatter>? inputFormatters;
final Color cursorColor;
final Color focusedBorderColor;
final Color textColor;
final Color inactiveBorderColor;

const InputTextField(
{super.key,
Expand All @@ -30,7 +34,11 @@ class InputTextField extends StatefulWidget {
this.onTextChange,
this.errorText,
this.onVaildate,
this.inputFormatters});
this.inputFormatters,
this.cursorColor = AppColors.focusedBorder,
this.focusedBorderColor = AppColors.focusedBorder,
this.inactiveBorderColor = AppColors.inActiveBorder,
this.textColor = AppColors.primaryTextColor});

@override
State<InputTextField> createState() => _InputTextFieldState();
Expand Down Expand Up @@ -65,6 +73,8 @@ class _InputTextFieldState extends State<InputTextField> {
TextFormField(
key: widget.formKey,
controller: widget.controller,
cursorColor: widget.cursorColor,
style: FontStyles.labelMedium.copyWith(color: widget.textColor),
obscureText: widget.isObscureText ? obscureText : false,
decoration: InputDecoration(
labelText: widget.labelText,
Expand All @@ -75,33 +85,38 @@ class _InputTextFieldState extends State<InputTextField> {
errorText: null,
suffixIcon: widget.isObscureText
? InkWell(
splashColor: Colors.transparent,
canRequestFocus: false,
hoverColor: Colors.transparent,
focusColor: Colors.transparent,
highlightColor: Colors.transparent,
onTap: () => changeVisiblity(),
child: Container(
padding: const EdgeInsets.only(right: 20),
child: isPasswordVisible
? const Icon(Icons.visibility)
: const Icon(Icons.visibility_off),
? Icon(Icons.visibility,color: widget.textColor,)
: Icon(Icons.visibility_off,color: widget.textColor),
),
)
: const SizedBox.shrink(),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: _isHovered
? AppColors.focusedBorder // Hover border color
: AppColors.inActiveBorder, // Default border color
color: (widget.errorText != null && widget.errorText!.isNotEmpty)? Colors.red : _isHovered
? widget.focusedBorderColor // Hover border color
: widget.inactiveBorderColor, // Default border color
),
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
color:
(widget.errorText != null && widget.errorText!.isNotEmpty)
? Colors.red
: AppColors.focusedBorder, // Active border color
: widget.focusedBorderColor, // Active border color
),
),
disabledBorder: const OutlineInputBorder(
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: AppColors.inActiveBorder, // Disabled border color
color: widget.inactiveBorderColor, // Disabled border color
),
),
focusedErrorBorder: const OutlineInputBorder(
Expand Down
5 changes: 5 additions & 0 deletions lib/constants/color_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,9 @@ class AppColors{
static const Color sellerSignUpBg = Color(0xffe6e7ea);
static const Color sellerButtonBg = Color(0xff101522);
static const Color greyButtonBg = Color(0xff949698);
static const Color stepperInactiveBorder = Color(0xffdcdce5);
static const Color defaultIconColor = Color(0xff788295);
static const Color defaultTextColor = Color(0xff788295);
static const Color sellerTextFieldBorder = Color(0xffe2e4e9);
static const Color sellerTextFieldTextColor = Color(0xff848e9f);
}
Loading