fixed some login design bug in table and desktop

This commit is contained in:
llsajjad
2025-08-10 14:42:04 +03:30
parent 55d7d96baf
commit 4d4fbd2da1
8 changed files with 224 additions and 91 deletions
+47 -26
View File
@@ -15,6 +15,7 @@ class BaseButton extends StatelessWidget {
final double? borderRadius;
final double? elevation;
final double? width;
final bool isLoading;
const BaseButton({
required this.isEnabled,
@@ -27,39 +28,59 @@ class BaseButton extends StatelessWidget {
this.borderRadius,
this.elevation,
this.width,
this.isLoading = false,
super.key,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: width ?? double.infinity,
height: 55.0.h(),
child: ElevatedButton(
onPressed: isEnabled ? onPressed : null,
style: ElevatedButton.styleFrom(
backgroundColor:
backgroundColor ??
(isEnabled ? AppColors.mainBlue : AppColors.backgroundColor),
foregroundColor: textColor ?? AppColors.backgroundColor,
elevation: elevation ?? 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius ?? 28.0.w()),
side: BorderSide(
color: borderColor ?? Colors.transparent,
width: borderWidth ?? 0,
return isLoading
? Container(
width: double.infinity,
height: 55.0.h(),
decoration: BoxDecoration(
color: AppColors.mainBlue,
borderRadius: BorderRadius.circular(28.0.w()),
),
child: Center(
child: SizedBox(
width: 30.0.w(),
height: 30.0.w(),
child: CircularProgressIndicator(
strokeWidth: 4.0,
color: AppColors.white,
),
),
),
),
child: Text(
text ?? AppStrings.loginButton,
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.bold,
color: textColor ?? AppColors.backgroundColor,
)
: SizedBox(
width: width ?? double.infinity,
height: 55.0.h(),
child: ElevatedButton(
onPressed: isEnabled ? onPressed : null,
style: ElevatedButton.styleFrom(
backgroundColor:
backgroundColor ??
(isEnabled ? AppColors.mainBlue : AppColors.backgroundColor),
foregroundColor: textColor ?? AppColors.backgroundColor,
elevation: elevation ?? 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(borderRadius ?? 28.0.w()),
side: BorderSide(
color: borderColor ?? Colors.transparent,
width: borderWidth ?? 0,
),
),
),
child: Text(
text ?? AppStrings.loginButton,
style: TextStyle(
fontSize: 16.0.sp(),
fontWeight: FontWeight.bold,
color: textColor ?? AppColors.backgroundColor,
),
),
),
),
),
);
);
}
}