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),
        ),
      ),
    );
  }
}
