You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
//
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
class JdButton extends StatelessWidget {
|
|
final Color color;
|
|
final String text;
|
|
final double textSize;
|
|
final Object onTop;
|
|
final double height;
|
|
final double width;
|
|
final double circular;
|
|
|
|
JdButton(
|
|
{Key key,
|
|
this.color = Colors.black,
|
|
this.text = "按钮",
|
|
this.textSize = 18,
|
|
this.onTop,
|
|
this.height = 68,
|
|
this.width = 130,
|
|
this.circular = 10})
|
|
: super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return InkWell(
|
|
onTap: this.onTop,
|
|
child: Container(
|
|
alignment: Alignment(0, 0),
|
|
margin: EdgeInsets.all(5),
|
|
padding: EdgeInsets.all(5),
|
|
width: ScreenUtil().setWidth(this.width),
|
|
height: ScreenUtil().setHeight(this.height),
|
|
decoration: BoxDecoration(color: color, borderRadius: BorderRadius.circular(circular)),
|
|
child: Text(
|
|
text,
|
|
style: TextStyle(color: Colors.white, fontSize: textSize),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|