Added detailst design
This commit is contained in:
@@ -1,17 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../core/constants/colors.dart';
|
||||
import '../../../core/constants/strings.dart';
|
||||
import '../../../core/utils/size_config.dart';
|
||||
|
||||
class LoginButton extends StatelessWidget {
|
||||
class BaseButton extends StatelessWidget {
|
||||
final bool isEnabled;
|
||||
final VoidCallback? onPressed;
|
||||
final String? text;
|
||||
final Color? textColor;
|
||||
final Color? backgroundColor;
|
||||
final Color? borderColor;
|
||||
final double? borderWidth;
|
||||
final double? borderRadius;
|
||||
final double? elevation;
|
||||
|
||||
const LoginButton({
|
||||
super.key,
|
||||
const BaseButton({
|
||||
required this.isEnabled,
|
||||
required this.onPressed,
|
||||
this.text,
|
||||
this.textColor,
|
||||
this.backgroundColor,
|
||||
this.borderColor,
|
||||
this.borderWidth,
|
||||
this.borderRadius,
|
||||
this.elevation,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -20,19 +33,29 @@ class LoginButton extends StatelessWidget {
|
||||
width: double.infinity,
|
||||
height: 55.0.h(),
|
||||
child: ElevatedButton(
|
||||
onPressed: onPressed,
|
||||
onPressed: isEnabled ? onPressed : null,
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: isEnabled ? AppColors.mainBlue : Colors.grey[300],
|
||||
foregroundColor: Colors.white,
|
||||
backgroundColor: backgroundColor ??
|
||||
(isEnabled ? AppColors.mainBlue : Colors.grey[300]),
|
||||
foregroundColor: textColor ?? Colors.white,
|
||||
elevation: elevation ?? 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(28.0.w()),
|
||||
borderRadius: BorderRadius.circular(borderRadius ?? 28.0.w()),
|
||||
side: BorderSide(
|
||||
color: borderColor ?? Colors.transparent,
|
||||
width: borderWidth ?? 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
AppStrings.loginButton,
|
||||
style: TextStyle(fontSize: 16.0.sp(), fontWeight: FontWeight.bold),
|
||||
text ?? AppStrings.loginButton,
|
||||
style: TextStyle(
|
||||
fontSize: 16.0.sp(),
|
||||
fontWeight: FontWeight.bold,
|
||||
color: textColor ?? Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user