import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; /// 背景带渐变色的button socialchatGradientButton({ double radius = 25, LinearGradient? gradient, required Function onPress, required String text, Color textColor = Colors.white, double textSize = 14, }) { return GestureDetector( child: Container( height: 28.w, alignment: AlignmentDirectional.center, margin: EdgeInsetsDirectional.fromSTEB(5, 5, 0, 5), padding: EdgeInsets.symmetric(horizontal: 5.w), decoration: BoxDecoration( borderRadius: BorderRadius.circular(radius), gradient: gradient ?? LinearGradient(colors: [Colors.white, Colors.white]), ), child: Text(text, style: TextStyle(color: textColor, fontSize: textSize)), ), onTap: () { onPress(); }, ); }