-
Notifications
You must be signed in to change notification settings - Fork 105
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
13fb3b1
commit 78d6f99
Showing
7 changed files
with
114 additions
and
44 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
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
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 |
---|---|---|
@@ -1,46 +1,47 @@ | ||
// ignore_for_file: public_member_api_docs, sort_constructors_first | ||
import 'package:dio/dio.dart'; | ||
import 'package:flutter/foundation.dart'; | ||
|
||
class LinkDetails { | ||
final String link; | ||
final String method; | ||
final Object? body; | ||
final Map<String, String>? headers; | ||
final Map<String, dynamic>? queryParameters; | ||
final ResponseType responseType; | ||
LinkDetails({ | ||
required this.link, | ||
this.headers, | ||
this.body, | ||
this.method = 'GET', | ||
this.queryParameters, | ||
this.responseType = ResponseType.bytes, | ||
}); | ||
|
||
LinkDetails copyWith({ | ||
String? link, | ||
String? method, | ||
Object? body, | ||
Map<String, String>? headers, | ||
}) { | ||
return LinkDetails( | ||
link: link ?? this.link, | ||
body: body ?? this.body, | ||
method: method ?? this.method, | ||
headers: headers ?? this.headers, | ||
); | ||
} | ||
|
||
@override | ||
String toString() => 'LinkDetails(link: $link, headers: $headers)'; | ||
|
||
@override | ||
bool operator ==(covariant LinkDetails other) { | ||
if (identical(this, other)) return true; | ||
|
||
return other.link == link && | ||
mapEquals(other.headers, headers) && | ||
other.method == method && | ||
other.body == body; | ||
other.body == body && | ||
mapEquals(other.headers, headers) && | ||
mapEquals(other.queryParameters, queryParameters) && | ||
other.responseType == responseType; | ||
} | ||
|
||
@override | ||
int get hashCode => | ||
link.hashCode ^ headers.hashCode ^ method.hashCode ^ body.hashCode; | ||
int get hashCode { | ||
return link.hashCode ^ | ||
method.hashCode ^ | ||
body.hashCode ^ | ||
headers.hashCode ^ | ||
queryParameters.hashCode ^ | ||
responseType.hashCode; | ||
} | ||
|
||
@override | ||
String toString() { | ||
return 'LinkDetails(link: $link, method: $method, body: $body, headers: $headers, queryParameters: $queryParameters, responseType: $responseType)'; | ||
} | ||
} |
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
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