mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Merge branch 'dev' of https://github.com/SyncrowIOT/web into feature/space-management
This commit is contained in:
@ -16,8 +16,9 @@ class DefaultButton extends StatelessWidget {
|
||||
this.foregroundColor,
|
||||
this.borderRadius,
|
||||
this.height = 40,
|
||||
this.width = 140,
|
||||
this.padding,
|
||||
this.borderColor,
|
||||
this.elevation,
|
||||
});
|
||||
final void Function()? onPressed;
|
||||
final Widget child;
|
||||
@ -32,7 +33,8 @@ class DefaultButton extends StatelessWidget {
|
||||
final ButtonStyle? customButtonStyle;
|
||||
final Color? backgroundColor;
|
||||
final Color? foregroundColor;
|
||||
final double? width;
|
||||
final Color? borderColor;
|
||||
final double? elevation;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -42,38 +44,42 @@ class DefaultButton extends StatelessWidget {
|
||||
? null
|
||||
: customButtonStyle ??
|
||||
ButtonStyle(
|
||||
fixedSize: WidgetStateProperty.all(Size(width ?? 50, height ?? 40)), // Set button height
|
||||
textStyle: MaterialStateProperty.all(
|
||||
textStyle: WidgetStateProperty.all(
|
||||
customTextStyle ??
|
||||
Theme.of(context).textTheme.bodySmall!.copyWith(
|
||||
fontSize: 13,
|
||||
color: foregroundColor,
|
||||
fontWeight: FontWeight.normal),
|
||||
),
|
||||
foregroundColor: MaterialStateProperty.all(
|
||||
foregroundColor: WidgetStateProperty.all(
|
||||
isSecondary
|
||||
? Colors.black
|
||||
: enabled
|
||||
? foregroundColor ?? Colors.white
|
||||
: Colors.black,
|
||||
),
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) {
|
||||
backgroundColor: WidgetStateProperty.resolveWith<Color>(
|
||||
(Set<WidgetState> states) {
|
||||
return enabled
|
||||
? backgroundColor ?? ColorsManager.primaryColor
|
||||
: Colors.black.withOpacity(0.2);
|
||||
}),
|
||||
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
|
||||
shape: WidgetStateProperty.all(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(borderRadius ?? 10),
|
||||
side: BorderSide(color: borderColor ?? Colors.transparent),
|
||||
borderRadius: BorderRadius.circular(borderRadius ?? 20),
|
||||
),
|
||||
),
|
||||
padding: MaterialStateProperty.all(
|
||||
EdgeInsets.all(padding ?? 10),
|
||||
),
|
||||
minimumSize: MaterialStateProperty.all(
|
||||
fixedSize: WidgetStateProperty.all(
|
||||
const Size.fromHeight(50),
|
||||
),
|
||||
padding: WidgetStateProperty.all(
|
||||
EdgeInsets.all(padding ?? 10),
|
||||
),
|
||||
minimumSize: WidgetStateProperty.all(
|
||||
const Size.fromHeight(50),
|
||||
),
|
||||
elevation: WidgetStateProperty.all(elevation ?? 0),
|
||||
),
|
||||
child: SizedBox(
|
||||
height: height ?? 50,
|
||||
|
Reference in New Issue
Block a user