WallPaper_FSX_Flutter/lib/common/components/button/base_textbutton.dart
fengshengxiong 9caadfb09a 1.按照UI图修改
2.完善其他功能
2024-05-17 17:02:22 +08:00

61 lines
1.4 KiB
Dart

// Author: fengshengxiong
// Date: 2024/5/7
// Description: BaseTextButton
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:now_wallpaper/res/themes/app_styles.dart';
class BaseTextButton extends StatelessWidget {
final double? width;
final double? height;
final ButtonStyle? buttonStyle;
final Color? bgColor;
final double? radius;
final String? label;
final TextStyle? textStyle;
final Widget? child;
final Function()? onTap;
const BaseTextButton({
super.key,
this.label,
this.width,
this.height,
this.buttonStyle,
this.bgColor,
this.radius,
this.textStyle,
this.child,
this.onTap,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
height: height,
child: TextButton(
onPressed: onTap,
style: buttonStyle ??
baseTextButtonStyle(
bgColor: bgColor,
radius: radius,
),
child: child ??
Text(
label ?? '',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: textStyle ??
TextStyle(
color: const Color(0xFF333333),
fontSize: 16.sp,
fontWeight: FontWeight.w600,
),
),
),
);
}
}