Browse documentation

FEATURE DOCUMENTATION

Test APIs and Mock JSON in Flutter App Studio

Explore response behavior before wiring a network request into a prototype.

3 min readPractical guide
In this guide

Start with local scenarios

Switch to Preview to use the app without selection handles. Walk through the important journey from beginning to end. For commerce, add an item, open the bag and change its quantity. For chat, type a message and confirm that the composer clears after sending locally. For Snake, choose a speed, start a run, pause, and check the results screen.

Use API to add a connection, then open Test in API lab. Mock mode can simulate success, a slow response, an empty list, an HTTP error or offline behavior. Nothing is sent to the entered endpoint in mock mode. Live mode sends a public HTTPS GET request and requires the endpoint to allow browser access through CORS.

Apply a valid connection and connect it to a Request API action step. Inspect the returned JSON, loading state and error message. Keep private service keys and authenticated requests in a separate backend integration. The browser API lab is designed for public GET endpoints.

Compare success and failure

ScenarioWhat to inspect
SuccessExpected JSON structure and content.
SlowUnderstandable loading feedback.
EmptyA helpful explanation when there are no items.
HTTP errorA useful failure message rather than a blank interface.
OfflineHow a failed request affects the flow.

Mock mode does not contact the entered endpoint or change live server data. It makes scenarios repeatable during visual app development.

Send a public HTTPS GET

  1. Open API and select a connection.
  2. Open Test in API lab.
  3. Choose Live HTTPS GET.
  4. Enter a public browser-accessible endpoint.
  5. Send the request and inspect status and response.

HTTPS and compatible CORS are required. A request may succeed in a desktop client but fail in a browser with restricted cross-origin access. This is not an authenticated API proxy: keep secrets out of endpoint URLs and public project definitions.

Use the connection in a workflow

After testing, use the connection in a supported Request API action. Inspect how results affect state and what happens on failure. Start with one field or collection to distinguish a binding error from a network error.

The AI connection is separate. Provider keys and GPT access codes do not belong in this lab. Continue authenticated writes and persistence in exported source. See workflow configuration and AI settings for those tasks.

Keep a response example with the project

Use a small fictional JSON response while deciding which fields a screen needs. Record whether the response is an object, a collection or an empty value, then test the corresponding binding. A wrong response shape can look like a rendering problem when the actual issue is the data contract.

After changing an endpoint or mock sample, repeat success and failure checks. Keep a useful empty state and an understandable loading indicator. Production retry rules and authenticated service behavior should be reviewed in the exported app rather than assumed from a successful local mock.

TRY WHAT YOU LEARNED

Make one useful change.

Open the example, test a flow, and keep an editable source ZIP.

Open the example