notion_api
notion_api copied to clipboard
How to work with typed blocks by design?
Hi, please explain how you design work with typed Block (e.g. Paragraph) after retrieve Page?
NotionResponse resBlocks =
await notion.blocks.list(block_id: 'YYYYYYYYY');
Pagination paging = resBlocks.content;
for (Block block in paging.blocks) {
if (block.isParagraph) {
//<-- HOW TO GET Paragraph Object ?
}
}
`
Right now only can be obtained from jsonContent attribute :(
NotionResponse resBlocks =
await notion.blocks.list(block_id: 'YYYYYYYYY');
Pagination paging = resBlocks.content;
for (Block block in paging.blocks) {
if (block.isParagraph) {
print(block.jsonContent);
}
}
I don't like a lot of things in this package, so I'm doing it again almost from scratch breaking my mind in the process. I will think about a way to solve this problem for this new version.
Thanks for letting me know and sorry for all my mess here hehe
Thanks, it's clear now. Dude, the code is great, don't worry. It would be worse if it didn't exist at all. Let's try to fix the current one and support those who already use it. May the force be with you)