chore: fix and format using melos
This commit is contained in:
@@ -34,10 +34,12 @@ class Convert {
|
||||
|
||||
static String mapToQuery(Map<String, String> map, {Encoding? encoding}) {
|
||||
final pairs = <List<String>>[];
|
||||
map.forEach((key, value) => pairs.add([
|
||||
Uri.encodeQueryComponent(key, encoding: encoding ?? utf8),
|
||||
Uri.encodeQueryComponent(value, encoding: encoding ?? utf8)
|
||||
]),);
|
||||
map.forEach(
|
||||
(key, value) => pairs.add([
|
||||
Uri.encodeQueryComponent(key, encoding: encoding ?? utf8),
|
||||
Uri.encodeQueryComponent(value, encoding: encoding ?? utf8)
|
||||
]),
|
||||
);
|
||||
return pairs.map((pair) => '${pair[0]}=${pair[1]}').join('&');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ import 'dart:math';
|
||||
import 'package:wyatt_http_client/src/utils/convert.dart';
|
||||
import 'package:wyatt_http_client/src/utils/crypto.dart';
|
||||
|
||||
class DigestAuth { // request counter
|
||||
class DigestAuth {
|
||||
// request counter
|
||||
|
||||
DigestAuth(this.username, this.password);
|
||||
String username;
|
||||
|
||||
@@ -22,7 +22,7 @@ enum HttpMethods {
|
||||
patch('PATCH'),
|
||||
delete('DELETE');
|
||||
|
||||
final String method;
|
||||
|
||||
const HttpMethods(this.method);
|
||||
|
||||
final String method;
|
||||
}
|
||||
|
||||
@@ -81,10 +81,13 @@ enum HttpStatus {
|
||||
// Client generated status code.
|
||||
networkConnectTimeoutError(599);
|
||||
|
||||
final int statusCode;
|
||||
|
||||
const HttpStatus(this.statusCode);
|
||||
|
||||
factory HttpStatus.from(int status) =>
|
||||
HttpStatus.values.firstWhere((element) => element.statusCode == status);
|
||||
|
||||
final int statusCode;
|
||||
|
||||
bool equals(Object other) {
|
||||
if (other is HttpStatus) {
|
||||
return statusCode == other.statusCode;
|
||||
@@ -104,8 +107,4 @@ enum HttpStatus {
|
||||
bool isClientError() => statusCode >= 400 && statusCode < 500;
|
||||
|
||||
bool isServerError() => statusCode >= 500 && statusCode < 600;
|
||||
|
||||
factory HttpStatus.from(int status) => HttpStatus.values
|
||||
.firstWhere((element) => element.statusCode == status);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// Copyright (C) 2022 WYATT GROUP
|
||||
// Please see the AUTHORS file for details.
|
||||
//
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// any later version.
|
||||
//
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user