Skip to content

Commit

Permalink
added custom touch effect builders
Browse files Browse the repository at this point in the history
  • Loading branch information
jorre127 committed Feb 23, 2024
1 parent bf1c439 commit a71d97b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/src/widget/touch_feedback/touch_feedback.dart
Expand Up @@ -19,13 +19,15 @@ class TouchEffectInfo {
final Offset touchPosition;
final BorderRadius? borderRadius;
final AnimationController? animationController;
final Color? tapColor;

TouchEffectInfo({
required this.touchPosition,
required this.isTouched,
required this.animationController,
required this.durationInSeconds,
required this.borderRadius,
required this.tapColor,
});
}

Expand All @@ -50,9 +52,13 @@ class TouchFeedBack extends StatelessWidget {
final bool isAndroidDark;
final bool isIosDark;

/// Custom touch effect builders will be show on top of the child in a stack
final List<TouchEffectBuilder> touchEffectBuilders;

const TouchFeedBack({
required this.child,
required this.onTapped,
this.touchEffectBuilders = const <TouchEffectBuilder>[],
this.isAndroidDark = true,
this.isIosDark = true,
this.tapColor,
Expand Down Expand Up @@ -92,6 +98,7 @@ class TouchFeedBack extends StatelessWidget {
: androidLightRippleColor,
),
],
...touchEffectBuilders,
],
child: Material(
color: color,
Expand Down
1 change: 1 addition & 0 deletions lib/src/widget/touch_feedback/touch_manager.dart
Expand Up @@ -117,6 +117,7 @@ class _TouchManagerState extends State<TouchManager>
animationController: _animationController,
durationInSeconds: durationSeconds,
borderRadius: widget.borderRadius,
tapColor: widget.tapColor,
),
),
),
Expand Down

0 comments on commit a71d97b

Please sign in to comment.