-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57d7406
commit 763558b
Showing
9 changed files
with
128 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# https://dart.dev/guides/libraries/private-files | ||
# Created by `dart pub` | ||
.dart_tool/ | ||
|
||
# Avoid committing pubspec.lock for library packages; see | ||
# https://dart.dev/guides/libraries/private-files#pubspeclock. | ||
pubspec.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include: package:sizzle_lints/sizzle_lints.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
library rest_client; | ||
|
||
export 'src/rest_client_base.dart'; | ||
export 'src/exception/network_exception.dart'; | ||
export 'src/rest_client.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:http/http.dart' as http; | ||
import 'package:rest_client/src/rest_client_base.dart'; | ||
|
||
abstract class RestClient { | ||
factory RestClient({ | ||
required String baseUrl, | ||
http.Client? client, | ||
}) = RestClientBase; | ||
|
||
Future<Map<String, Object?>> get( | ||
String path, { | ||
Map<String, Object?>? headers, | ||
Map<String, Object?>? queryParams, | ||
}); | ||
|
||
Future<Map<String, Object?>> post( | ||
String path, { | ||
required Map<String, Object?> body, | ||
Map<String, Object?>? headers, | ||
Map<String, Object?>? queryParams, | ||
}); | ||
|
||
Future<Map<String, Object?>> put( | ||
String path, { | ||
required Map<String, Object?> body, | ||
Map<String, Object?>? headers, | ||
Map<String, Object?>? queryParams, | ||
}); | ||
|
||
Future<Map<String, Object?>> delete( | ||
String path, { | ||
Map<String, Object?>? headers, | ||
Map<String, Object?>? queryParams, | ||
}); | ||
|
||
Future<Map<String, Object?>> patch( | ||
String path, { | ||
required Map<String, Object?> body, | ||
Map<String, Object?>? headers, | ||
Map<String, Object?>? queryParams, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: rest_client | ||
description: A starting point for Dart libraries or applications. | ||
version: 1.0.0 | ||
# repository: https://github.com/my_org/my_repo | ||
|
||
environment: | ||
sdk: '>=2.19.6 <3.0.0' | ||
|
||
# dependencies: | ||
# path: ^1.8.0 | ||
|
||
dev_dependencies: | ||
sizzle_lints: ^1.0.10 | ||
test: ^1.21.0 | ||
dependencies: | ||
http: ^0.13.6 | ||
meta: ^1.8.0 | ||
path: ^1.8.0 |
Oops, something went wrong.