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.
61 lines
1.8 KiB
61 lines
1.8 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; //是否有边框
|
|
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,
|
|
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(
|
|
alignment: Alignment.center,
|
|
padding: EdgeInsets.symmetric(vertical: 15.w),
|
|
margin: widget.blM
|
|
? EdgeInsets.symmetric(horizontal: 32.w)
|
|
: EdgeInsets.only(left: 0.w),
|
|
decoration: BoxDecoration(
|
|
border: Border.all(
|
|
color: const Color(0xFF1890FF),
|
|
width: !widget.border ? 1.w : 10.w),
|
|
gradient: LinearGradient(
|
|
begin: Alignment.centerLeft,
|
|
end: Alignment.centerRight,
|
|
colors: [widget.color1, widget.color2]),
|
|
borderRadius: BorderRadius.circular(8.w)),
|
|
child: Text(
|
|
widget.text,
|
|
style: TextStyle(
|
|
fontSize: BaseStyle.fontSize28, color: widget.textColor),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|