24 lines
798 B
Dart
24 lines
798 B
Dart
// Author: fengshengxiong
|
|
// Date: 2024/5/8
|
|
// Description: 样式
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
ButtonStyle baseTextButtonStyle({double? radius, Color? bgColor}) {
|
|
return ButtonStyle(
|
|
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
backgroundColor: MaterialStateProperty.all(bgColor ?? Colors.white),
|
|
overlayColor: MaterialStateProperty.resolveWith<Color>((Set<MaterialState> states) {
|
|
if (states.contains(MaterialState.pressed)) return Colors.black12;
|
|
return Colors.transparent;
|
|
}),
|
|
shape: MaterialStateProperty.all(
|
|
RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(radius ?? 24).r,
|
|
),
|
|
),
|
|
);
|
|
}
|