Analyzed Jul 13, 2026
This skill provides standard instructions and examples for implementing REST API requests in Flutter using the official `http` package. It follows development best practices for networking, permissions, and performance.
flutter/agent-plugins · Official
Use the `http` package to execute GET, POST, PUT, or DELETE requests. Use when you need to fetch from or send data to a REST API.
npx skills add flutter/agent-plugins --skill flutter-use-http-package
Audit results are mixed — compare nearby options before installing.
Architects a Flutter application using the recommended layered approach (UI, Logic, Data). Use …
34.4K installsUse `LayoutBuilder`, `MediaQuery`, or `Expanded/Flexible` to create a layout that adapts to dif…
33.3K installsFixes Flutter layout errors (overflows, unbounded constraints) using Dart and Flutter MCP tools…
31.9K installsImplement a component-level test using `WidgetTester` to verify UI rendering and user interacti…
31.1K installsRelated neighbors and high-traction skills in the same topics — useful to compare before installing.
Helps users discover and install agent skills when they ask questions like "how do I do X", "fi…
3.3M installsBrowser automation CLI for AI agents. Use when the user needs to interact with websites, includ…
810.4K installsReview UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "chec…
617.3K installsBuild, deploy, evaluate, optimize, fine-tune, and manage Microsoft Foundry agents, models, and …
576.5K installsPrepare azd-based Azure projects for deployment: generates azure.yaml, infrastructure (Bicep/Te…
568.3K installsPartner security reviews for this skill.
Analyzed Jul 13, 2026
This skill provides standard instructions and examples for implementing REST API requests in Flutter using the official `http` package. It follows development best practices for networking, permissions, and performance.
Analyzed Jul 13, 2026
[HIGH] W007: Insecure credential handling detected in skill instructions. [MEDIUM] W011: Third-party content exposure detected (indirect prompt injection risk).
Analyzed Jul 13, 2026
0 alerts
Other skills from flutter/agent-plugins · top by installs.
npx skills add flutter/agent-plugins
Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.
main
Parsed from SKILL.md frontmatter.
Files included with this skill beyond the listing page.
SKILL.md
6,456 B
SUMMARY.md
161 B
Configure the environment and platform-specific permissions required for network access.
http package dependency via the terminal:``bash flutter pub add http ``
``dart import 'package:http/http.dart' as http; ``
android/app/src/main/AndroidManifest.xml:``xml <uses-permission android:name="android.permission.INTERNET" /> ``
macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements:``xml <key>com.apple.security.network.client</key> <true/> ``
Execute HTTP operations and map responses to strongly typed Dart objects.
Uri.parse('your_url').headers parameter map. Use HttpHeaders.authorizationHeader for auth tokens.jsonEncode() from dart:convert.response.statusCode. Treat 200 OK (GET/PUT/DELETE) and 201 CREATED (POST) as success.null on failure, as this prevents FutureBuilder from triggering its error state and causes infinite loading indicators.jsonDecode(response.body) and map it to a custom Dart object using a factory constructor (e.g., fromJson).Offload expensive JSON parsing to a separate Isolate to prevent UI jank (frame drops).
package:flutter/foundation.dart.compute() function to run the parsing logic in a background isolate.compute() is a top-level function or a static method, as closures or instance methods cannot be passed across isolates.Use the following checklist to implement and validate network operations.
Task Progress:
fromJson factory constructor.Future<Model>.- If fetching data (GET): Append query parameters to the URI. - If mutating data (POST/PUT): Set 'Content-Type': 'application/json; charset=UTF-8' and attach the jsonEncode body. - If deleting data (DELETE): Return an empty model instance on success (200 OK).
statusCode and throw an Exception on failure.Future into the UI using FutureBuilder.snapshot.hasData, snapshot.hasError, and default to a CircularProgressIndicator.import 'dart:async';
import 'dart:convert';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
// 1. Top-level parsing function for Isolate
List<Photo> parsePhotos(String responseBody) {
final parsed = (jsonDecode(responseBody) as List<Object?>)
.cast<Map<String, Object?>>();
return parsed.map<Photo>(Photo.fromJson).toList();
}
// 2. Network execution with background parsing
Future<List<Photo>> fetchPhotos() async {
final response = await http.get(
Uri.parse('https://jsonplaceholder.typicode.com/photos'),
headers: {
HttpHeaders.authorizationHeader: 'Bearer your_token_here',
HttpHeaders.acceptHeader: 'application/json',
},
);
if (response.statusCode == 200) {
// Offload heavy parsing to a background isolate
return compute(parsePhotos, response.body);
} else {
throw Exception('Failed to load photos. Status: ${response.statusCode}');
}
}
// 3. Strongly typed model
class Photo {
final int id;
final String title;
final String thumbnailUrl;
const Photo({
required this.id,
required this.title,
required this.thumbnailUrl,
});
factory Photo.fromJson(Map<String, dynamic> json) {
return Photo(
id: json['id'] as int,
title: json['title'] as String,
thumbnailUrl: json['thumbnailUrl'] as String,
);
}
}
// 4. UI Integration
class PhotoGallery extends StatefulWidget {
const PhotoGallery({super.key});
@override
State<PhotoGallery> createState() => _PhotoGalleryState();
}
class _PhotoGalleryState extends State<PhotoGallery> {
late Future<List<Photo>> _futurePhotos;
@override
void initState() {
super.initState();
// Initialize Future once to prevent re-fetching on rebuilds
_futurePhotos = fetchPhotos();
}
@override
Widget build(BuildContext context) {
return FutureBuilder<List<Photo>>(
future: _futurePhotos,
builder: (context, snapshot) {
if (snapshot.hasData) {
final photos = snapshot.data!;
return ListView.builder(
itemCount: photos.length,
itemBuilder: (context, index) => ListTile(
leading: Image.network(photos[index].thumbnailUrl),
title: Text(photos[index].title),
),
);
} else if (snapshot.hasError) {
return Center(child: Text('Error: ${snapshot.error}'));
}
// Default loading state
return const Center(child: CircularProgressIndicator());
},
);
}
}