flutter-http-and-json

Installation
Summary

Secure HTTP networking and JSON handling for Flutter apps with background parsing support.

  • Implements CRUD operations (GET, POST, PUT, DELETE) using the http package with safe URL construction via Uri.https() and strict status code validation
  • Provides strongly typed JSON serialization and deserialization using Dart 3 pattern matching with factory constructors and toJson() methods
  • Offloads large JSON parsing to background isolates via compute() to prevent UI jank on payloads exceeding 16ms parse time
  • Integrates structured JSON schemas for AI model outputs, including Gemini response validation with firebase_vertexai
  • Requires http package in pubspec.yaml, Dart 3 null safety, and platform-specific internet permissions (Android manifest, macOS entitlements)
SKILL.md

flutter-http-json-networking

Goal

Manages HTTP networking and JSON data handling in Flutter applications. Implements secure, asynchronous REST API calls (GET, POST, PUT, DELETE) using the http package. Handles JSON serialization, background parsing via isolates for large datasets, and structured JSON schemas for AI model integrations. Assumes the http package is added to pubspec.yaml and the environment supports Dart 3 pattern matching and null safety.

Decision Logic

When implementing JSON parsing and serialization, evaluate the following decision tree:

  1. Payload Size:
    • If the JSON payload is small, parse synchronously on the main thread.
    • If the JSON payload is large (takes >16ms to parse), use background parsing via compute() to avoid UI jank.
  2. Model Complexity:
    • If the data model is simple or a quick prototype, use manual serialization (dart:convert).
    • If the data model is highly nested or part of a large production app, STOP AND ASK THE USER: "Should we configure json_serializable and build_runner for automated code generation?"

Instructions

1. Configure Platform Permissions

Before making network requests, ensure the target platforms have the required internet permissions.

Android (android/app/src/main/AndroidManifest.xml):

Related skills
Installs
987
Repository
flutter/skills
GitHub Stars
1.9K
First Seen
Mar 4, 2026