Flutter(플러터)

[플러터/Flutter] Dart 3.0, Flutter 3.10.0 업그레이드 시 Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'. 에러 날 때 해결책

알통몬_ 2023. 5. 25. 12:56
반응형

이 해결책은 flutter_html 을 사용할 경우에 해당됩니다.

얼마 전 구글 I/O 2023 에서 Dart, Flutter 의 새로운 버전을 발표 했고 저는 신나게 버전을 올렸습니다.

그러나..... 이게 웬걸 갑자기 에러가 본 적 없는 에러가 발생했씁니다.

../../.pub-cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:186:20: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.
 - 'TapDownDetails' is from 'package:flutter/src/gestures/tap.dart' ('../../development/flutter/packages/flutter/lib/src/gestures/tap.dart').
 - 'TapDragDownDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onTapDown: onTapDown,
                   ^
../../.pub-cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:190:24: Error: The argument type 'void Function(TapUpDetails)' can't be assigned to the parameter type 'void Function(TapDragUpDetails)?'.
 - 'TapUpDetails' is from 'package:flutter/src/gestures/tap.dart' ('../../development/flutter/packages/flutter/lib/src/gestures/tap.dart').
 - 'TapDragUpDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onSingleTapUp: onSingleTapUp,
                       ^
../../.pub-cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:195:26: Error: The argument type 'void Function(TapDownDetails)' can't be assigned to the parameter type 'void Function(TapDragDownDetails)?'.
 - 'TapDownDetails' is from 'package:flutter/src/gestures/tap.dart' ('../../development/flutter/packages/flutter/lib/src/gestures/tap.dart').
 - 'TapDragDownDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDoubleTapDown: onDoubleTapDown,
                         ^
../../.pub-cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:196:31: Error: The argument type 'void Function(DragStartDetails)' can't be assigned to the parameter type 'void Function(TapDragStartDetails)?'.
 - 'DragStartDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('../../development/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'TapDragStartDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDragSelectionStart: onDragSelectionStart,
                              ^
../../.pub-cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:197:32: Error: The argument type 'void Function(DragStartDetails, DragUpdateDetails)' can't be assigned to the parameter type 'void Function(TapDragUpdateDetails)?'.
 - 'DragStartDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('../../development/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'DragUpdateDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('../../development/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'TapDragUpdateDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDragSelectionUpdate: onDragSelectionUpdate,
                               ^
../../.pub-cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/gesture_detector_builder.dart:198:29: Error: The argument type 'void Function(DragEndDetails)' can't be assigned to the parameter type 'void Function(TapDragEndDetails)?'.
 - 'DragEndDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('../../development/flutter/packages/flutter/lib/src/gestures/drag_details.dart').
 - 'TapDragEndDetails' is from 'package:flutter/src/widgets/tap_and_drag_gestures.dart' ('../../development/flutter/packages/flutter/lib/src/widgets/tap_and_drag_gestures.dart').
        onDragSelectionEnd: onDragSelectionEnd,
                            ^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/Users/sunggyunpark/development/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1201

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/sunggyunpark/development/flutter/bin/flutter'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 8s

같은 이슈를 겪은 사람들의 글을 많이 봤고 여러 해결책이 나왔지만 전부 해당되지 않았습니다.

아래는 그러다 찾은 하나의 해결책입니다.

현재 flutter_html 의

 Latest: 2.2.1 / Prerelease: 3.0.0-beta.1

입니다.

이 버전을 Latest 가 아닌 Prerelease 버전으로 바꾸면 이슈가 해결됩니다.

반응형