自习室优化ok

This commit is contained in:
zhutao
2025-11-28 13:31:23 +08:00
parent 4ecb0c35d6
commit 57305c5804
57 changed files with 2500 additions and 597 deletions

View File

@@ -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,