Wallpaper-Genie/lib/res/themes/app_styles.dart
2024-07-22 17:52:41 +08:00

20 lines
730 B
Dart

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 ?? 22).r,
),
),
);
}