This commit is contained in:
2026-02-04 12:00:38 +09:00
parent cb48d0db48
commit adb6c2d20b
4 changed files with 138 additions and 16 deletions
@@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
class CustomButtonWidget extends StatelessWidget {
final Widget child;
final VoidCallback? onTap;
final String imagePath;
final double? width;
final double? height;
final EdgeInsetsGeometry padding;
final Color? backgroundColor;
const CustomButtonWidget({
super.key,
required this.child,
this.onTap,
this.imagePath = 'assets/images/icons/borders/border_000.png',
this.width,
this.height,
this.padding = EdgeInsets.zero,
this.backgroundColor,
});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
behavior: HitTestBehavior.opaque,
child: SizedBox(
width: width,
height: height,
child: Stack(
children: [
// Background Color
if (backgroundColor != null)
Positioned.fill(child: Container(color: backgroundColor)),
// Background Image (Border)
Positioned.fill(
child: Image.asset(
imagePath,
fit: BoxFit.fill,
filterQuality: FilterQuality.high,
),
),
// Content
Padding(
padding: padding,
child: Center(child: child),
),
],
),
),
);
}
}