49 lines
1.2 KiB
Dart
49 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:skripsi/config/theme.dart';
|
|
|
|
class CustButton extends StatelessWidget {
|
|
final VoidCallback onTap;
|
|
|
|
const CustButton(
|
|
{super.key,
|
|
required this.onTap,
|
|
required this.text,
|
|
required this.backgroundColor,
|
|
this.borderColor,
|
|
this.textColor,
|
|
required this.width,
|
|
required this.height,
|
|
this.textSize});
|
|
|
|
final String text;
|
|
final Color backgroundColor;
|
|
final Color? borderColor;
|
|
final Color? textColor;
|
|
final double width;
|
|
final double height;
|
|
final double? textSize;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
width: width,
|
|
height: height,
|
|
decoration: BoxDecoration(
|
|
color: backgroundColor,
|
|
borderRadius: BorderRadius.all(Radius.circular(20.w)),
|
|
border: Border.all(color: borderColor ?? backgroundColor)),
|
|
child: Center(
|
|
child: Text(
|
|
text,
|
|
style: robotoBesarPutih.copyWith(
|
|
fontSize: 16.sp, fontWeight: FontWeight.bold),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|