自习室优化ok
This commit is contained in:
@@ -6,18 +6,20 @@ import '../config/config.dart';
|
||||
class Button extends StatelessWidget {
|
||||
final double? width;
|
||||
final String text;
|
||||
final TextStyle textStyle;
|
||||
final ThemeType type;
|
||||
final BorderRadius radius;
|
||||
final VoidCallback onPressed;
|
||||
final VoidCallback? onPressed;
|
||||
final bool loading;
|
||||
final bool disabled;
|
||||
|
||||
const Button({
|
||||
super.key,
|
||||
this.width,
|
||||
this.textStyle = const TextStyle(),
|
||||
this.radius = const BorderRadius.all(Radius.circular(80)),
|
||||
required this.text,
|
||||
required this.onPressed,
|
||||
this.onPressed,
|
||||
this.type = ThemeType.primary,
|
||||
this.loading = false,
|
||||
this.disabled = false,
|
||||
@@ -34,7 +36,7 @@ class Button extends StatelessWidget {
|
||||
};
|
||||
|
||||
return Opacity(
|
||||
opacity: disabled || loading ? 0.5 : 1,
|
||||
opacity: disabled || loading ? 0.5 : 1,
|
||||
child: Container(
|
||||
width: width,
|
||||
decoration: bgDecoration.copyWith(borderRadius: radius),
|
||||
@@ -62,7 +64,7 @@ class Button extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
text,
|
||||
style: TextStyle(
|
||||
style: textStyle.copyWith(
|
||||
color: type != ThemeType.info ? Colors.white : Colors.black,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
|
||||
Reference in New Issue
Block a user