Agent skill
flutter-native-http-client
This blog post explores how to optimize HTTP client selection in Flutter applications based on the platform, using Cronet on Android and Cupertino's native client on iOS for improved performance and caching.
Install this agent skill to your Project
npx add-skill https://github.com/rodydavis/skills/tree/main/skills/snippets_flutter-native-http-client
Metadata
Additional technical details for this skill
- last modified
- Tue, 03 Feb 2026 20:04:29 GMT
SKILL.md
Flutter Native HTTP Client
import 'package:cronet_http/cronet_http.dart';
import 'package:cupertino_http/cupertino_http.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart';
import 'package:platform_info/platform_info.dart';
void main() async {
var clientFactory = Client.new;
final device = DeviceInfoPlugin();
if (platform.isAndroid) {
final engine = CronetEngine.build(
cacheMode: CacheMode.memory,
userAgent: (await device.androidInfo).model,
);
clientFactory = () => CronetClient.fromCronetEngine(engine);
} else if (platform.isCupertino) {
clientFactory = CupertinoClient.defaultSessionConfiguration.call;
}
runWithClient(() => runApp(const MyApp()),clientFactory);
}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
how-to-do-offline-recommendations-with-sqlite-and-gemini
Learn how to enhance your CMS like PocketBase with AI-powered content recommendations using text embeddings, SQLite, and k-nearest neighbor search for efficient and scalable related content suggestions.
how-to-build-a-webrtc-signal-server-with-pocketbase
Learn how to build a simple WebRTC video call application using PocketBase as a signaling server, enabling peer-to-peer communication with SQLite on the server and realtime updates via Server Sent Events.
flutter-terminal-cheat-sheet
This post provides a handy collection of Flutter commands and scripts for web development, package creation, troubleshooting, testing, and more, streamlining your Flutter workflow.
how-to-print-multiple-objects-to-the-console-with-print-in-dart
Learn how to print multiple objects to the console in Dart using Records, offering a similar experience to JavaScript's `console.log()` functionality.
flutter-input-output-preview
Build responsive Flutter apps with a reusable `TwoPane` widget and an `InputOutputPreview` component for side-by-side code and preview display on both mobile and desktop.
displaying-html-in-flutter
Easily display and interact with HTML content in your Flutter app using the `easy_web_view` package, which supports both web and mobile platforms.
Didn't find tool you were looking for?