Fetch sections
You can retrieve the blocks of the project with the function
MBManager.shared.getSections()
like this:MBPaginatedResponse<MBSection> sections =
await MBManager.shared.getSections(blockId: THE_BLOCK_ID);
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:
MBPaginatedResponse<MBSection> sections =
await MBManager.shared.getSections(
blockId: THE_BLOCK_ID,
includeElements: true,
);
If you include the elements, the propery
elements
of the section will be populated. The type of elements available are:MBTextElement
: represents a textMBImagesElement
: represents an imageMBMediaElement
: a fille, audio, video or documentMBCheckboxElement
: a checkboxMBRelationElement
: a relation between blocksMBMarkdownElement
: a markdown elementMBAddressElement
: an address, with its coordinatesMBColorElement
: a colorMBDateElement
: a dateMBDropdownElement
: a dropdown, with its possible values and the selected oneMBGeneralElement
: a general element, returned when the type is not recognized
Last modified 2yr ago