v0.0.3
apinion
Simplify API calls in Dart & Flutter with Apinion — clean syntax, built-in logging, and easy setup.
5Likes 4330-day downloads140Pub points
AndroidiOSWebmacOSWindowsLinux
Simplify API calls in Dart & Flutter with Apinion — clean syntax, built-in logging, and easy setup.
{"sdk":"flutter"}^1.4.0^2.5.0{"sdk":"flutter"}^4.0.0^1.24.0English project snapshot. Visit GitHub for the latest content.
apinion_logo
Apinion is a lightweight, developer-friendly Dart package that simplifies REST API calls in your Flutter or Dart apps.
logger packageimport 'package:apinion/apinion.dart';
void main() async {
ApinionConfig.init(
baseUrl: 'https://jsonplaceholder.typicode.com',
);
// GET request
final getResponse = await ApinionClient.get('/posts/1');
if (getResponse.isSuccess) {
print('Title: ${getResponse.responseData['title']}');
} else {
print('Error: ${getResponse.errorMessage}');
}
// POST request
final postResponse = await ApinionClient.post('/posts', body: {
'title': 'foo',
'body': 'bar',
'userId': 1,
});
if (postResponse.isSuccess) {
print('New Post ID: ${postResponse.responseData['id']}');
}
}