Closed schosdas closed 1 year ago
Hey, this problem is not related to this package. Exported json is valid, but as error says: Lib using nested arrays and Firestore don't support them (we have list of lines and every line has list of vertices). In fact we can update json, but then someone else will have problems with structure or other DB..
But my recommendation is: don't store RAW data to no-sql DB (whenever you can). Raw data will create complex document and you can easily run out of free read/write Firestore quota. But you have multiple options how to deal with it:
firebase_storage
where you can store png
or svg
file.base64
, where you can encode image or raw data and store them as single line.
base64Encode(utf8.encode(jsonEncode(control.toMap())))
Also onPointerUp
event is not best place to store data, because this will be called multiple times during drawing process.
My code is as follows. After drawing, I'm going to convert the data I drew into Json and upload it to Firestore. (And I'm going to get it back later.)
However, the following error is printed when uploading.
Nested arrays are not supported
There seems to be a problem with the json data. Is there a way to do this?