This is a simple Networking Request Builder, written in Dart using Dio.
Features
It's just simple to use! Look at the example!
Getting started
Please remember to add the package as a dependency.
flutter:
sdk: flutter
rizzu_client:
import 'package:rizzu_client/rizzu_client.dart';
then Just import this and u are ready to go!
Usage
RizzuClient rizzuClient = RizzuClient(baseUrl: 'https://jsonplaceholder.typicode.com/');
//GET REQUEST
await rizzuClient.call('posts', method: ApiMethod.GET);
//POST REQUEST
await rizzuClient.call('/posts', method: ApiMethod.POST, params: {
'id': 5,
'title': 'foo',
'body': 'bar',
'userId': '1',
});
//PUT REQUEST
await rizzuClient.call('/posts/1', method: ApiMethod.PUT, params: {
'id': 1,
'title': 'foo',
'body': 'hii',
'userId': '1',
});
Additional information
Feel free to contribute!