Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to compile application. #1398

Open
eqrakhattak opened this issue Dec 12, 2023 · 1 comment
Open

Failed to compile application. #1398

eqrakhattak opened this issue Dec 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@eqrakhattak
Copy link

Flutter Version

image

Flutter Doctor
image

Description:
I'm working on Flutter web which compiles correctly but as soon as I import flutter_html, it shows the following errors:

Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...

  • /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/layout_grid.dart:212:20: Error: Inferred type argument 'AutoPlacement' doesn't conform to the bound 'Enum?' of the type variable 'T' on 'EnumProperty'.

  • 'AutoPlacement' is from 'package:flutter_layout_grid/src/widgets/layout_grid.dart' ('/C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/layout_grid.dart').

  • 'Enum' is from 'dart:core'.
    Try specifying type arguments explicitly so that they conform to the bounds.
    properties.add(EnumProperty('autoPlacement', autoPlacement));
    ^
    /C:/src/flutter/flutter/packages/flutter/lib/src/foundation/diagnostics.dart:2258:20: Context: This is the type variable whose bound isn't conformed to.
    class EnumProperty<T extends Enum?> extends DiagnosticsProperty {
    ^
    /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:82:55: Error: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'.

  • 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/rendering/object.dart').

  • 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
    final AbstractNode? targetParent = renderObject.parent;
    ^
    /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:83:58: Error: The method 'markNeedsPlacement' isn't defined for the class 'AbstractNode?'.

  • 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'markNeedsPlacement'.
    if (targetParent is RenderLayoutGrid) targetParent.markNeedsPlacement();
    ^^^^^^^^^^^^^^^^^^
    /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:84:54: Error: The method 'markNeedsLayout' isn't defined for the class 'AbstractNode?'.

  • 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'markNeedsLayout'.
    if (targetParent is RenderObject) targetParent.markNeedsLayout();
    ^^^^^^^^^^^^^^^
    /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:132:55: Error: A value of type 'RenderObject?' can't be assigned to a variable of type 'AbstractNode?'.

  • 'RenderObject' is from 'package:flutter/src/rendering/object.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/rendering/object.dart').

  • 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
    final AbstractNode? targetParent = renderObject.parent;
    ^
    /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:133:58: Error: The method 'markNeedsPlacement' isn't defined for the class 'AbstractNode?'.

  • 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'markNeedsPlacement'.
    if (targetParent is RenderLayoutGrid) targetParent.markNeedsPlacement();
    ^^^^^^^^^^^^^^^^^^
    /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_layout_grid-1.0.6/lib/src/widgets/placement.dart:134:54: Error: The method 'markNeedsLayout' isn't defined for the class 'AbstractNode?'.

  • 'AbstractNode' is from 'package:flutter/src/foundation/node.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/foundation/node.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'markNeedsLayout'.
    if (targetParent is RenderObject) targetParent.markNeedsLayout();
    ^^^^^^^^^^^^^^^
    /C:/Users/eqrak/AppData/Local/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' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap.dart').

  • 'TapDragDownDetails' is from 'package:flutter/src/gestures/tap_and_drag.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap_and_drag.dart').
    onTapDown: onTapDown,
    ^
    /C:/Users/eqrak/AppData/Local/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' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap.dart').

  • 'TapDragUpDetails' is from 'package:flutter/src/gestures/tap_and_drag.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap_and_drag.dart').
    onSingleTapUp: onSingleTapUp,
    ^
    /C:/Users/eqrak/AppData/Local/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' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap.dart').

  • 'TapDragDownDetails' is from 'package:flutter/src/gestures/tap_and_drag.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap_and_drag.dart').
    onDoubleTapDown: onDoubleTapDown,
    ^
    /C:/Users/eqrak/AppData/Local/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' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').

  • 'TapDragStartDetails' is from 'package:flutter/src/gestures/tap_and_drag.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap_and_drag.dart').
    onDragSelectionStart: onDragSelectionStart,
    ^
    /C:/Users/eqrak/AppData/Local/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' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').

  • 'DragUpdateDetails' is from 'package:flutter/src/gestures/drag_details.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').

  • 'TapDragUpdateDetails' is from 'package:flutter/src/gestures/tap_and_drag.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap_and_drag.dart').
    onDragSelectionUpdate: onDragSelectionUpdate,
    ^
    /C:/Users/eqrak/AppData/Local/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' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/drag_details.dart').

  • 'TapDragEndDetails' is from 'package:flutter/src/gestures/tap_and_drag.dart' ('/C:/src/flutter/flutter/packages/flutter/lib/src/gestures/tap_and_drag.dart').
    onDragSelectionEnd: onDragSelectionEnd,
    ^
    /C:/Users/eqrak/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_math_fork-0.5.0/lib/src/widgets/selection/handle_overlay.dart:60:40: Error: Member not found: 'fadeDuration'.
    duration: TextSelectionOverlay.fadeDuration, vsync: this);
    ^^^^^^^^^^^^
    Failed to compile application.

I have added flutter_html: ^2.2.1 in my pubspec.yaml file.
Imported import 'package:flutter_html/flutter_html.dart';
Used HTML widget as:

Html(
     data: """<iframe style="border-radius:12px" src="https://open.spotify.com/embed/playlist/0Lg3GfMqCQGbCGAv0oQnpW?utm_source=generator" width="100%" height="352" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe> """,
),
@eqrakhattak eqrakhattak added the bug Something isn't working label Dec 12, 2023
@arifikhsan
Copy link

upgrade the version to flutter_html: ^3.0.0-alpha.3 fixed the error for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants