mobile_skt/lib/widgets/core/sk_ink.dart

49 lines
1.2 KiB
Dart
Raw Normal View History

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