didvan-app/lib/widgets/ink_wrapper.dart

39 lines
860 B
Dart

import 'package:flutter/material.dart';
class InkWrapper extends StatelessWidget {
final Color? splashColor;
final Color? highlightColor;
final Widget child;
final VoidCallback? onPressed;
final BorderRadius? borderRadius;
const InkWrapper({
Key? key,
this.splashColor,
this.highlightColor,
required this.child,
this.onPressed,
this.borderRadius,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
child,
Positioned.fill(
child: Material(
color: Colors.transparent,
child: InkWell(
borderRadius: borderRadius,
splashColor: splashColor,
highlightColor: highlightColor,
onTap: onPressed,
),
),
),
],
);
}
}