40 lines
942 B
Dart
40 lines
942 B
Dart
import 'package:didvan/config/design_config.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 = DesignConfig.lowBorderRadius,
|
|
}) : 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,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|