singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 839 forks source link

Error type Null is not a subject of type 'Object' #2357

Closed rymesaint closed 1 week ago

rymesaint commented 2 weeks ago

Is there an existing issue for this?

Flutter Quill version

10.8.5

Steps to reproduce

Create ordered list

  1. A
  2. B
  3. C

Expected results

  1. A
  2. B
  3. C

Actual results

Error Null is not subtype of type 'Object'

This is how the result of database

[{"insert": "A"}, {"insert": null, "attributes": {"list": "ordered"}}, {"insert": "B"}, {"insert": null, "attributes": {"list": "ordered"}}, {"insert": "C"}, {"insert": null, "attributes": {"list": "ordered"}}, {"insert": "D"}, {"insert": null, "attributes": {"list": "ordered"}}, {"insert": "E"}, {"insert": null, "attributes": {"list": "ordered"}}]

Additional Context

Screenshots / Video demonstration [Upload media here]
Logs ```console [Paste your logs here] ```
EchoEllet commented 1 week ago

@rymesaint

Is this still an issue, why it was closed?

rymesaint commented 1 week ago

i've found the problem the documentation is using jsonEncode method to make {"insert" : null} into {"insert": "\n"} which i did it before like this

document.toDelta().toJson()

when it should be like this

jsonEncode(document.toDelta().toJson())