flint_client 0.0.1+3
flint_client: ^0.0.1+3 copied to clipboard
A powerful, type-safe HTTP client for Dart with interceptors, caching, retries, and comprehensive error handling."
Changelog #
0.0.1+3 #
0.0.1+2 #
- π Added full WebSocket communication support directly on
FlintClientvia.wc. client.wcreturns aFlintWebSocketClientinstance for real-time communication.- Works just like Socket.io β supports
on,emit,off,join, andleaveevents. - Maintains
onMessageandonJsonMessagecompatibility 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.