FHapticFeedback class final
The haptic feedback configuration.
Each field corresponds to a static method on Flutter's HapticFeedback class and defaults to calling it. To disable all haptic feedback, use FHapticFeedback.none.
// Disable all haptic feedback:
FHapticFeedback.none()
// Customize a specific effect:
FHapticFeedback(selectionClick: () async => debugPrint('click!'))
- Mixed-in types
Constructors
-
FHapticFeedback({Future<
void> heavyImpact() = HapticFeedback.heavyImpact, Future<void> lightImpact() = HapticFeedback.lightImpact, Future<void> mediumImpact() = HapticFeedback.mediumImpact, Future<void> selectionClick() = HapticFeedback.selectionClick, Future<void> successNotification() = HapticFeedback.successNotification, Future<void> warningNotification() = HapticFeedback.warningNotification, Future<void> errorNotification() = HapticFeedback.errorNotification, Future<void> vibrate() = HapticFeedback.vibrate}) -
Creates an FHapticFeedback.
const
- FHapticFeedback.none()
-
Creates an FHapticFeedback with no haptic feedback.
const
Properties
-
errorNotification
→ Future<
void> Function() -
Provides a haptic feedback indicating that a task or action has failed.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
-
heavyImpact
→ Future<
void> Function() -
Provides a haptic feedback corresponding to a collision impact with a heavy mass.
final
-
lightImpact
→ Future<
void> Function() -
Provides a haptic feedback corresponding to a collision impact with a light mass.
final
-
mediumImpact
→ Future<
void> Function() -
Provides a haptic feedback corresponding to a collision impact with a medium mass.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selectionClick
→ Future<
void> Function() -
Provides a haptic feedback corresponding to a UI selection tick.
final
-
successNotification
→ Future<
void> Function() -
Provides a haptic feedback indicating that a task or action has completed successfully.
final
-
vibrate
→ Future<
void> Function() -
Provides vibration haptic feedback to the user.
final
-
warningNotification
→ Future<
void> Function() -
Provides a haptic feedback indicating that a task or action has produced a warning.
final
Methods
-
copyWith(
{Future< void> heavyImpact()?, Future<void> lightImpact()?, Future<void> mediumImpact()?, Future<void> selectionClick()?, Future<void> successNotification()?, Future<void> warningNotification()?, Future<void> errorNotification()?, Future<void> vibrate()?}) → FHapticFeedback - Returns a copy of this FHapticFeedback with the given properties replaced.
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
noFeedback(
) → Future< void> - A no-op haptic feedback function.