restbase

Creator: coderz1093

Last updated:

0 purchases

restbase Image
restbase Images
Add to Cart

Description:

restbase

rest #
A rest client base to make API requests.
Example
class LoginApi extends Rest {
LoginApi() {
this.addInterceptor(PrintLogInterceptor());
}

@override
String get restUrl => BASE_AUTH_URL_API;

Future<RestResult<User>> login(String user, String password) =>
postModel("/login", { "user": user, "password": password }, User.fromJson);
}

class User {
int id;
String userName;
String token;

static User fromJson(Map<String, dynamic> json) {
///... parse json to User
}

Map<String, dynamic> toJson() {
//... properties to map
}
}
copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.

Related Products

More From This Creator