flutter avatar

Flutter Use Http Package

Need a Flutter networking guide you can actually follow without digging through docs? This skill walks through the `http` package for GET, POST, PUT, and DELETE calls against a REST API. It covers the boring-but-breaking setup first: the INTERNET permission on Android and the network client entitlement on macOS, both of which fail silently if you forget them. The useful opinion buried in here is the error handling: it says to throw on non-success status codes rather than return null, because returning null leaves a FutureBuilder spinning forever. It also pushes JSON parsing into a background isolate via compute() to avoid frame drops on large payloads. The worked example fetches a photo list, parses it off the main thread, and wires it into a FutureBuilder with proper loading and error states. Good starting point if you're new to Flutter networking.

skills.sh installs
37.9K
GitHub stars
3.2K
last updated
Oct 26, 2026

Install

$ npx -y skills add flutter/agent-plugins --skill flutter-use-http-package --agent claude-code

Installs into .claude/skills of the current project.

Files

Implementing Flutter Networking

Contents

Configuration & Permissions

Configure the environment and platform-specific permissions required for network access.

  1. Add the http package dependency via the terminal:
    flutter pub add http
    
  2. Import the package in your Dart files:
    import 'package:http/http.dart' as http;
    
  3. Configure Android permissions by adding the Internet permission to android/app/src/main/AndroidManifest.xml:
    <uses-permission android:name="android.permission.INTERNET" />
    
  4. Configure macOS entitlements by adding the network client key to both macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements:
    <key>com.apple.security.network.client</key>
    <true/>
    

Request Execution & Response Handling

Sponsors

Details

Repository
github.com/flutter/agent-plugins
Categories
Backend & APIs, AI & Agent Building, Mobile Development
First seen
Oct 26, 2026

More from flutter/agent-plugins

All 10
1clerk avatarclerk-cliclerk/skillsOperate the Clerk CLI (`clerk` binary) for authentication, user/org/session management, impersonation, local webhook testing, deploy verification, instance conf35.8Kskills.sh installs
2clerk avatarclerkclerk/skillsClerk authentication router. Use when user asks about Clerk CLI operations, adding authentication, setting up Clerk, custom sign-in flows, Swift or native iOS a30.9Kskills.sh installs
3caffeinelabs avatarextension-posting-to-xcaffeinelabs/skillsMANDATORY recipe for every Caffeine build that posts to X (Twitter). The ONLY supported path is the `x-client` mops package with OAuth 2.0 PKCE. Hand-rolling `i29.8Kskills.sh installs
4jimliu avatarbaoyu-danger-gemini-webjimliu/baoyu-skillsGenerates images and text via reverse-engineered Gemini Web API. Supports text generation, image generation from prompts, reference images for vision input, and28.3Kskills.sh installs
5caffeinelabs avatarconnector-googlemailcaffeinelabs/skillsMANDATORY recipe for every Caffeine build that sends email through the user's own Gmail account. The ONLY supported path is the `googlemail-client` mops package27.7Kskills.sh installs
6wshobson avatarfastapi-templateswshobson/agentsCreate production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications26.5Kskills.sh installs