added 3 screen mod to login
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/constants/assets.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class LoginLogo extends StatelessWidget {
|
||||
const LoginLogo({super.key});
|
||||
LoginLogo({required this.width,required this.height,super.key});
|
||||
|
||||
double width;
|
||||
double height;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Image.asset(AssetsManager.logo, width: 190.0.w(), height: 88.0.h());
|
||||
return Image.asset(AssetsManager.logo, );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ class LoginTextField extends StatelessWidget {
|
||||
final String iconPath;
|
||||
final bool isPassword;
|
||||
final bool obscureText;
|
||||
final double? borderRedus;
|
||||
final double? fieldHeight;
|
||||
final double? prefixIconPadding;
|
||||
final VoidCallback? onToggleVisibility;
|
||||
|
||||
const LoginTextField({
|
||||
@@ -22,52 +25,62 @@ class LoginTextField extends StatelessWidget {
|
||||
super.key,
|
||||
this.isPassword = false,
|
||||
this.obscureText = false,
|
||||
this.fieldHeight,
|
||||
this.onToggleVisibility,
|
||||
this.borderRedus,
|
||||
this.prefixIconPadding,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextField(
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
obscureText: isPassword ? obscureText : false,
|
||||
decoration: InputDecoration(
|
||||
labelText: label,
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.all(12.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
iconPath,
|
||||
width: 24.0.w(),
|
||||
height: 24.0.h(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
focusNode.hasFocus ? Colors.black87 : Colors.grey,
|
||||
BlendMode.srcIn,
|
||||
return SizedBox(
|
||||
height: fieldHeight ?? 55.0.h(),
|
||||
child: TextField(
|
||||
controller: controller,
|
||||
focusNode: focusNode,
|
||||
obscureText: isPassword ? obscureText : false,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: (fieldHeight != null ? (fieldHeight! / 2.8) : 16.0).h(),
|
||||
horizontal: 12.0.w(),
|
||||
),
|
||||
labelText: label,
|
||||
prefixIcon: Padding(
|
||||
padding: EdgeInsets.all(prefixIconPadding ?? 12.0.w()),
|
||||
child: SvgPicture.asset(
|
||||
iconPath,
|
||||
width: 24.0.w(),
|
||||
height: 24.0.h(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
focusNode.hasFocus ? Colors.black87 : Colors.grey,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
suffixIcon:
|
||||
isPassword
|
||||
? IconButton(
|
||||
onPressed: onToggleVisibility,
|
||||
icon: SvgPicture.asset(
|
||||
obscureText
|
||||
? AssetsManager.passwordVisibility
|
||||
: AssetsManager.passwordVisibilityOff,
|
||||
width: 24.0.w(),
|
||||
height: 24.0.h(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
focusNode.hasFocus ? Colors.black87 : Colors.grey,
|
||||
BlendMode.srcIn,
|
||||
suffixIcon:
|
||||
isPassword
|
||||
? IconButton(
|
||||
onPressed: onToggleVisibility,
|
||||
icon: SvgPicture.asset(
|
||||
obscureText
|
||||
? AssetsManager.passwordVisibility
|
||||
: AssetsManager.passwordVisibilityOff,
|
||||
width: 24.0.w(),
|
||||
height: 24.0.h(),
|
||||
colorFilter: ColorFilter.mode(
|
||||
focusNode.hasFocus ? Colors.black87 : Colors.grey,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: null,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12.0.w()),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: AppColors.borderBlue),
|
||||
borderRadius: BorderRadius.circular(12.0.w()),
|
||||
)
|
||||
: null,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(borderRedus ?? 12.0.w()),
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: AppColors.borderBlue),
|
||||
borderRadius: BorderRadius.circular(borderRedus ?? 12.0.w()),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user