mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 09:45:22 +00:00
Modified Devices Pages
This commit is contained in:
@ -13,6 +13,8 @@ class DefaultButton extends StatelessWidget {
|
||||
this.isDone = false,
|
||||
this.customTextStyle,
|
||||
this.customButtonStyle,
|
||||
this.backgroundColor,
|
||||
this.foregroundColor,
|
||||
});
|
||||
|
||||
final void Function()? onPressed;
|
||||
@ -29,6 +31,10 @@ class DefaultButton extends StatelessWidget {
|
||||
|
||||
final ButtonStyle? customButtonStyle;
|
||||
|
||||
final Color? backgroundColor;
|
||||
|
||||
final Color? foregroundColor;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ElevatedButton(
|
||||
@ -41,17 +47,22 @@ class DefaultButton extends StatelessWidget {
|
||||
customTextStyle ??
|
||||
context.bodyMedium.copyWith(
|
||||
fontSize: 16,
|
||||
color: foregroundColor,
|
||||
),
|
||||
),
|
||||
foregroundColor: MaterialStateProperty.all(
|
||||
isSecondary
|
||||
? Colors.black
|
||||
: enabled
|
||||
? Colors.white
|
||||
? foregroundColor ?? Colors.white
|
||||
: Colors.black,
|
||||
),
|
||||
backgroundColor: MaterialStateProperty.all(
|
||||
enabled ? ColorsManager.primaryColor : Colors.grey),
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color>(
|
||||
(Set<MaterialState> states) {
|
||||
return enabled
|
||||
? backgroundColor ?? ColorsManager.primaryColor
|
||||
: Colors.grey;
|
||||
}),
|
||||
shape: MaterialStateProperty.all(
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
|
Reference in New Issue
Block a user