fixed some login design bug in table and desktop
This commit is contained in:
@@ -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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user