runFunction method

Future runFunction(
  1. BuildContext context,
  2. HapticFeedbackAction action
)

Implementation

Future<dynamic> runFunction(
    BuildContext context, HapticFeedbackAction action) async {
  try {
    if (action is VibrateHapticFeedbackAction) {
      HapticFeedback.vibrate();
      return;
    }
    throw Exception('No function found');
  } catch (e) {
    context.logsCubit.onNewLog(
      EditorLogEntity(
        id: _uuid.v1(),
        content: e.toString(),
        createdAt: DateTime.now(),
      ),
    );
  }
  return;
}