skip to Main Content

Error: The getter ‘value’ isn’t defined for the class ‘XmlNode’.

  • ‘XmlNode’ is from ‘package:xml/src/xml/nodes/node.dart’ (‘/C:/Users/User/AppData/Local/Pub/Cache/hosted/pub.dev/xml-6.2.2/lib/src/xml/nodes/node.dart’).
    Try correcting the name to the name of an existing getter, or defining a getter or field named ‘value’.
    .map((node) => node.value)

Anyone had experience with this error

3

Answers


  1. Chosen as BEST ANSWER

    I cleared that error.I added 2 dependancys pdf and xml for testing. but i didnt used that.

    then i deleted from pubspec.yamel.But the dependecys cache stored in pubspec.lock.

    then i dlt 2 dependancys caches but that regenerate itselt.them i edited that dependancys pub.dev link and runned success fully


  2. i was facing the same issue i changed

    from this

    final text = element.children
        .where((node) => node is XmlText || node is XmlCDATA)
        .map((node) => node.value)
        .join()
        .trim();
    

    to this

    final text = element.children
        .where((node) => node is XmlText || node is XmlCDATA)
        .map((node) => node.text) //change value to text 
        .join()
        .trim();
    

    in /home/munsif/.pub-cache/hosted/pub.dev/pdf-3.10.2/lib/src/svg/text.dart
    and this solve my problem.

    Login or Signup to reply.
  3. It is not a good idea to solve it by editing the local cache.

    The error happens because you need to update xml version to >= 6.3.0

    if you are not using xml directly in pubspec.yaml, then there are packages that you are using depend on the xml package and you have to update them.

    To know which packages depend on xml, run flutter pub deps

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search