Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Html View Returns Error When Imported

Tags:

flutter

dart

I have successfully installed the dependency in pubspec.yaml and the exit code was 0. When I import 'package:flutter_html_view/flutter_html_view.dart'; It shows that it has been imported via vs code (It underlines it as imported but not used)**

But when I save or restart my emulator, it will refuse to build. returning the following errors:

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:326:49: Error: The getter 'children' isn't defined for the class 'InlineSpan'.

 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
        List<TextSpan> children = previous.text.children != null
                                                ^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:327:41: Error: The getter 'children' isn't defined for the class 'InlineSpan'.

 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
          ? new List.from(previous.text.children)
                                        ^^^^^^^^

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:326:49: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.
        List<TextSpan> children = previous.text.children != null
                                                ^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_markdown-0.2.0/lib/src/builder.dart:327:41: Error: The getter 'children' isn't defined for the class 'InlineSpan'.
 - 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'children'.

          ? new List.from(previous.text.children)
                                        ^^^^^^^^```
like image 296
DigitalBraine Avatar asked Nov 06 '22 02:11

DigitalBraine


1 Answers

What are your SDK constraints? You're using an extremely old version (0.2.0) of package:flutter_markdown from 2018, back from before Flutter was even stable. Using the latest compatible version (^0.6.2, ideally) should fix your issue.

like image 59
Ben Konyi Avatar answered Nov 15 '22 08:11

Ben Konyi