> For the complete documentation index, see [llms.txt](https://docs.mburger.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mburger.cloud/flutter-sdk/fetch-blocks.md).

# Fetch blocks

You can retrieve the blocks of the project with the function **`MBManager.shared.getBlocks()`** like this:

```dart
MBPaginatedResponse<MBBLock> blocks = await MBManager.shared.getBlocks();
```

The parameter named **`parameters`** is an optional array of objects that conforms to the **`MBParameter`** protocol that will be passed to the MBurger api as parameter.&#x20;

The majority of the parameters that can be passed to the apis are already implemented in the SDK and can be used after the initialization:

* `MBSortParameter`
* `MBPaginationParameter`
* `MBFilterParameter`
* `MBGeofenceParameter`

{% hint style="info" %}
If you want to pass another type of parameter you can use the MBGeneralParameter class that can be initialized with a key and a value that will be passed to the apis.
{% endhint %}

So if you want to include a pagination parameter you can do this:

```dart
MBPaginationParameter paginationParam =
        MBPaginationParameter(skip: 0, take: 10);
MBPaginatedResponse<MBBlock> blocks =
        await MBManager.shared.getBlocks(parameters: [paginationParam]);
```

If you set the `includeSections` parameter you can include also the sections of the blocks, if you set also `includeElements` parameter also the elements will be included in the response.

So, you could retrieve the information of all the blocks, all the sections of the blocks, and all the elements of the sections with this call:

```dart
MBPaginationParameter paginationParam =
      MBPaginationParameter(skip: 0, take: 10);
MBPaginatedResponse<MBBlock> blocks = await MBManager.shared.getBlocks(
      parameters: [paginationParam],
      includeSections: true,
      includeElements: true,
);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mburger.cloud/flutter-sdk/fetch-blocks.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
