2024-04-08 13:50:23 +08:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:sk_base_mobile/app_theme.dart';
|
2024-04-09 08:31:17 +08:00
|
|
|
import 'package:sk_base_mobile/constants/bg_color.dart';
|
|
|
|
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
|
2024-04-08 13:50:23 +08:00
|
|
|
|
|
|
|
class SkInk extends StatelessWidget {
|
|
|
|
final Widget? child;
|
|
|
|
final void Function()? onTap;
|
|
|
|
final BorderRadius? borderRadius;
|
|
|
|
final BoxBorder? border;
|
2024-04-09 08:31:17 +08:00
|
|
|
|
|
|
|
final Color? color;
|
|
|
|
final EdgeInsets? padding;
|
|
|
|
final EdgeInsets? margin;
|
|
|
|
final Gradient? gradient;
|
2024-04-08 13:50:23 +08:00
|
|
|
const SkInk(
|
2024-04-09 08:31:17 +08:00
|
|
|
{super.key,
|
|
|
|
this.child,
|
|
|
|
this.onTap,
|
|
|
|
this.color,
|
|
|
|
this.borderRadius,
|
|
|
|
this.border,
|
|
|
|
this.gradient,
|
|
|
|
this.margin,
|
|
|
|
this.padding});
|
2024-04-08 13:50:23 +08:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-04-09 08:31:17 +08:00
|
|
|
return Container(
|
|
|
|
margin: margin,
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius: borderRadius ?? BorderRadius.zero,
|
|
|
|
child: Material(
|
|
|
|
child: Ink(
|
|
|
|
padding: padding,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: border,
|
|
|
|
color: color,
|
|
|
|
gradient: gradient,
|
|
|
|
borderRadius: borderRadius,
|
|
|
|
),
|
|
|
|
child: InkWell(
|
|
|
|
borderRadius: borderRadius, onTap: onTap, child: child)),
|
|
|
|
),
|
|
|
|
),
|
2024-04-08 13:50:23 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|