Currently the editor supports only image and video embeds. We need to add support for albums. But these albums are custom crafted to fit our app. Therefore we need support for generic custom embeds.
Had a look in the codebase, apparently the embeds are initialised via this line of code
If the value of an insert op is string then it inits strings. Otherwise it goes for embeds. It uses the embed builder. Current version uses only 2 embeds: image or video. At the time when I forked apparently the web images were disable even if working... Looks like we can render image embeds just fine.
I forked before the custom embeds were added. I looked trough the code that supports embeds, it's not that hard to replicate. Also had a scan trough the code that renders the embeds. The default embed builder is rather straight forward business.
The trouble is that it needs a good dose of cleanup (component diagram style). Right now it's all in monolith methods
We should deal with that. That's how text_line makes use of the embed builder.
Either it renders a one paragraph embed or in mix mode
Read this part here
Here there's logic for rendering embeds within text lines
Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.
Currently the editor supports only image and video embeds. We need to add support for albums. But these albums are custom crafted to fit our app. Therefore we need support for generic custom embeds.
Had a look in the codebase, apparently the embeds are initialised via this line of code
If the value of an insert op is string then it inits strings. Otherwise it goes for embeds. It uses the embed builder. Current version uses only 2 embeds: image or video. At the time when I forked apparently the web images were disable even if working... Looks like we can render image embeds just fine.
I forked before the custom embeds were added. I looked trough the code that supports embeds, it's not that hard to replicate. Also had a scan trough the code that renders the embeds. The default embed builder is rather straight forward business.
The trouble is that it needs a good dose of cleanup (component diagram style). Right now it's all in monolith methods We should deal with that. That's how text_line makes use of the embed builder.
Either it renders a one paragraph embed or in mix mode
Read this part here
Here there's logic for rendering embeds within text lines
Obviously we need doc page and tests.
Ref: 877
Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.