app-starlock/star_lock/lib/tools/submitBtn.dart
Daisy 3ff5e63d53 1,更新部分UI
2,新增部分图片
3,新增选择网关页面
2023-07-26 09:23:25 +08:00

101 lines
2.3 KiB
Dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../app_settings/app_colors.dart';
/*
* 提交按钮 公用组件
* */
class SubmitBtn extends StatelessWidget {
String? btnName;
Function()? onClick;
EdgeInsetsGeometry? margin;
EdgeInsetsGeometry? padding;
double? width;
double? fontSize;
Color? color;
List<Color>? backgroundColorList;
double? borderRadius;
SubmitBtn(
{Key? key,
required this.btnName,
this.borderRadius,
this.color,
this.padding,
this.onClick,
this.margin,
this.width,
this.backgroundColorList,
this.fontSize})
: super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: ScreenUtil().screenWidth - 40.w,
height: 44,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.mainColor,
),
onPressed: () {
if (onClick != null) {
onClick!();
}
},
child: Text(
btnName!,
style: TextStyle(color: Colors.white, fontSize: 30.sp),
)),
);
/*
return GestureDetector(
child: Container(
width: width??690.w,
padding: padding??EdgeInsets.only(
top: 20.w,
bottom: 20.w
),
margin: margin??EdgeInsets.only(top: 30.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(borderRadius ?? 10.w),
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: backgroundColorList ??
[
AppColors.mainColor,
AppColors.mainColor,
],
)),
child: Center(
child: Text(btnName!,
style: TextStyle(
fontSize: fontSize ?? 30.sp,
height: 1.3,
decoration: TextDecoration.none,
fontWeight: FontWeight.w500,
color: color ?? Colors.white)),
),
),
onTap: () {
if (onClick != null) {
onClick!();
}
},
);
*/
}
}