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
72 lines
2.1 KiB
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; //是否有边框
|
|
final double opacity;
|
|
final int hPadding;
|
|
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,
|
|
this.opacity = 1,
|
|
this.hPadding=64,
|
|
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(
|
|
height: 84.w,
|
|
alignment: Alignment.center,
|
|
padding: EdgeInsets.symmetric(vertical: 14.w),
|
|
margin: widget.blM
|
|
? EdgeInsets.symmetric(horizontal: widget.hPadding.w)
|
|
: EdgeInsets.only(left: 0.w),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color:
|
|
!widget.border ? const Color(0xFF1890FF) : Colors.white,
|
|
width: !widget.border ? 1.w : 0.w),
|
|
gradient: LinearGradient(
|
|
begin: Alignment.centerLeft,
|
|
end: Alignment.centerRight,
|
|
colors: [
|
|
widget.color1.withOpacity(widget.opacity),
|
|
widget.color2.withOpacity(widget.opacity)
|
|
]),
|
|
borderRadius: BorderRadius.circular(8.w)),
|
|
child: Text(
|
|
widget.text,
|
|
style: TextStyle(
|
|
fontSize: BaseStyle.fontSize28,
|
|
color: widget.textColor,
|
|
fontWeight: FontWeight.bold),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|