You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.1 KiB

2 years ago
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../base/base_style.dart';
class PloneBottom extends StatefulWidget {
final String text;
final Color color1;
final Color color2;
final Color textColor;
final Function() onTap;
final bool blM; //是否间距
final bool border; //是否有边框
2 years ago
final double opacity;
2 years ago
final int hPadding;
2 years ago
const PloneBottom({
Key? key,
this.text = '返回首页',
this.color1 = const Color(0xFF0593FF),
this.color2 = const Color(0xFF027AFF),
this.textColor = kForeGroundColor,
this.blM = true,
this.border = false,
2 years ago
this.opacity = 1,
2 years ago
this.hPadding=64,
2 years ago
required this.onTap,
});
@override
State<PloneBottom> createState() => _PloneBottomState();
}
class _PloneBottomState extends State<PloneBottom> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: widget.onTap,
child: Material(
color: Colors.transparent,
child: Container(
2 years ago
height: 84.w,
2 years ago
alignment: Alignment.center,
2 years ago
padding: EdgeInsets.symmetric(vertical: 14.w),
2 years ago
margin: widget.blM
2 years ago
? EdgeInsets.symmetric(horizontal: widget.hPadding.w)
2 years ago
: EdgeInsets.only(left: 0.w),
decoration: BoxDecoration(
border: Border.all(
2 years ago
color:
!widget.border ? const Color(0xFF1890FF) : Colors.white,
width: !widget.border ? 1.w : 0.w),
2 years ago
gradient: LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
2 years ago
colors: [
widget.color1.withOpacity(widget.opacity),
widget.color2.withOpacity(widget.opacity)
]),
2 years ago
borderRadius: BorderRadius.circular(8.w)),
child: Text(
widget.text,
style: TextStyle(
2 years ago
fontSize: BaseStyle.fontSize28,
color: widget.textColor,
fontWeight: FontWeight.bold),
2 years ago
),
),
),
);
}
}