support primary color

This commit is contained in:
Siyi Guo committed 2023-04-13 16:43:48 +08:00
1 parent 595ee6fd6a
commit 90f53a0578
3 files changed
+39 -15

No files matched your search

+2 -2
View File
@@ -41,13 +41,13 @@ class EasyButton extends StatelessWidget {
if (states.contains(MaterialState.disabled)) {
return Colors.grey.withOpacity(0.5);
}
return color ?? (type == ButtonType.secondary ? Colors.white : Colors.blue);
return color ?? (type == ButtonType.secondary ? Colors.white : Theme.of(context).primaryColor);
}),
foregroundColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return Colors.grey.withOpacity(0.1);
}
return color ?? (type == ButtonType.secondary ? Colors.white : Colors.blue);
return color ?? (type == ButtonType.secondary ? Colors.white : Theme.of(context).primaryColor);
}),
minimumSize: MaterialStateProperty.all(Size(minWidth, height)),
shape: MaterialStateProperty.all(