flint_client 0.0.1+2 copy "flint_client: ^0.0.1+2" to clipboard
flint_client: ^0.0.1+2 copied to clipboard

A powerful, type-safe HTTP client for Dart with interceptors, caching, retries, and comprehensive error handling."

Changelog #

0.0.1+2 #

  • πŸ”— Added full WebSocket communication support directly on FlintClient via .wc.
  • client.wc returns a FlintWebSocketClient instance for real-time communication.
  • Works just like Socket.io β€” supports on, emit, off, join, and leave events.
  • Maintains onMessage and onJsonMessage compatibility for existing projects.
  • Supports JWT authentication headers for secure socket connections.
  • Auto-reconnects with exponential backoff after disconnection.
  • Connection lifecycle events: connected, disconnected, reconnected, error.
  • Integrated room and broadcast system for scalable multi-user apps.
  • Compatible with Flutter, Dart console, and Flint Dart backend.

πŸ’‘ Example: Using Flint WebSocket via .wc #

import 'package:flint_client/flint_client.dart';

void main() async {
  final client = FlintClient(
    baseUrl: "https://api.example.com",
    token: "your_jwt_token_here",
  );

  // Access WebSocket through the .wc property
  final ws = client.wc("/chat");

  // Listen for connection
  ws.on("connected", (_) => print("βœ… Connected to WebSocket"));

  // Listen for JSON messages
  ws.onJsonMessage((data) {
    print("Received JSON: $data");
  });

  // Listen for custom event
  ws.on("chat_message", (data) {
    print("πŸ’¬ Message: $data");
  });

  // Emit (send) event
  ws.emit("send_message", {"text": "Hello from Flint Client"});

  // Join a room
  ws.join("general");

  // Broadcast example
  ws.broadcast("system_notice", {"msg": "Server update incoming..."});
}

0.0.1+1 #

  • Improved HTTP client stability.
  • Added file upload/download with progress tracking.
  • Support for request interceptors and customizable status code handling.
  • Enhanced caching and retry mechanism for failed requests.

0.0.1 #

  • Initial release of Flint Client.
  • Complete HTTP client with caching, retry, and interceptors.
  • Support for custom status code configurations.
  • File upload/download with progress tracking.
2
likes
160
points
29
downloads

Publisher

verified publisherflintdart.eulogia.net

Weekly Downloads

A powerful, type-safe HTTP client for Dart with interceptors, caching, retries, and comprehensive error handling."

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

clock, path

More

Packages that depend on flint_client