You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

40 regels
1012 B

  1. import 'package:flutter/material.dart';
  2. class InkWrapper extends StatelessWidget {
  3. final Color splashColor;
  4. final Color highlightColor;
  5. final Widget child;
  6. final VoidCallback? onTap;
  7. final double borderRadius;
  8. final ShapeBorder? border;
  9. InkWrapper(
  10. {this.splashColor = const Color.fromARGB(26, 181, 181, 181),
  11. this.highlightColor = const Color.fromARGB(26, 118, 118, 118),
  12. required this.child,
  13. required this.onTap,
  14. this.borderRadius = 10,
  15. this.border});
  16. @override
  17. Widget build(BuildContext context) {
  18. return Stack(
  19. children: <Widget>[
  20. child,
  21. Positioned.fill(
  22. child: Material(
  23. color: Colors.transparent,
  24. child: InkWell(
  25. borderRadius: BorderRadius.circular(borderRadius),
  26. splashColor: splashColor,
  27. highlightColor: highlightColor,
  28. customBorder: border,
  29. onTap: onTap,
  30. ),
  31. ),
  32. ),
  33. ],
  34. );
  35. }
  36. }