Fetch sections
You can retrieve the blocks of the project with the function MBManager.shared.getSections() like this:
1
MBPaginatedResponse<MBSection> sections =
2
await MBManager.shared.getSections(blockId: THE_BLOCK_ID);
Copied!
The parameters value is an array of MBParameter objects as described in the previous section.
You can set the includeElements parameter to true if you want to include also the elements of the sections.
If you want to retrieve all the sections of a block and their elements you can call:
1
MBPaginatedResponse<MBSection> sections =
2
await MBManager.shared.getSections(
3
blockId: THE_BLOCK_ID,
4
includeElements: true,
5
);
Copied!

Elements

If you include the elements, the propery elements of the section will be populated. The type of elements available are:
    MBTextElement: represents a text
    MBImagesElement: represents an image
    MBMediaElement: a fille, audio, video or document
    MBCheckboxElement: a checkbox
    MBRelationElement: a relation between blocks
    MBMarkdownElement: a markdown element
    MBAddressElement: an address, with its coordinates
    MBColorElement: a color
    MBDateElement: a date
    MBDropdownElement: a dropdown, with its possible values and the selected one
    MBGeneralElement: a general element, returned when the type is not recognized
Last modified 1yr ago
Copy link
Contents
Elements