-
Notifications
You must be signed in to change notification settings - Fork 0
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
720a4c5
commit 29fc2ed
Showing
6 changed files
with
336 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
import 'package:tdproto_dart/tdproto_dart.dart'; | ||
|
||
part 'response.freezed.dart'; | ||
part 'response.g.dart'; | ||
|
||
/// Response | ||
@freezed | ||
abstract class Response with _$Response { | ||
const factory Response({ | ||
/// Debug time | ||
@JsonKey(name: '_time') String time, | ||
|
||
/// Whether http status code is 200 or not | ||
@JsonKey(name: 'ok') @required bool ok, | ||
|
||
/// Requested data | ||
@JsonKey(name: 'result') dynamic result, | ||
|
||
/// Error code | ||
@JsonKey(name: 'error') String error, | ||
|
||
/// Details about the error | ||
@JsonKey(name: 'details') Map<String, dynamic> details, | ||
}) = _Response; | ||
|
||
factory Response.fromJson(Map<String, dynamic> json) => _$ResponseFromJson(json); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.