mirror of
https://github.com/lifegpc/eh_downloader_flutter.git
synced 2026-07-08 01:30:28 +08:00
style: format code
This commit is contained in:
@@ -26,6 +26,7 @@ class ApiResult<T> {
|
||||
return throw error!;
|
||||
}
|
||||
}
|
||||
|
||||
(int, String) unwrapErr() {
|
||||
if (ok) {
|
||||
return throw 'unwrap_err called on ok ApiResult';
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:cryptography/cryptography.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:eh_downloader_flutter/api/file.dart';
|
||||
import 'package:retrofit/retrofit.dart';
|
||||
|
||||
import 'api_result.dart';
|
||||
import 'gallery.dart';
|
||||
import 'status.dart';
|
||||
@@ -47,6 +49,7 @@ enum SortByGid {
|
||||
none,
|
||||
asc,
|
||||
desc;
|
||||
|
||||
bool? toBool() {
|
||||
switch (this) {
|
||||
case SortByGid.asc:
|
||||
|
||||
@@ -8,9 +8,13 @@ class MeilisearchInfo {
|
||||
required this.host,
|
||||
required this.key,
|
||||
});
|
||||
|
||||
final String host;
|
||||
final String key;
|
||||
factory MeilisearchInfo.fromJson(Map<String, dynamic> json) => _$MeilisearchInfoFromJson(json);
|
||||
|
||||
factory MeilisearchInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$MeilisearchInfoFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$MeilisearchInfoToJson(this);
|
||||
}
|
||||
|
||||
@@ -23,6 +27,7 @@ class ServerStatus {
|
||||
this.meilisearch,
|
||||
required this.noUser,
|
||||
});
|
||||
|
||||
@JsonKey(name: 'ffmpeg_api_enabled')
|
||||
final bool ffmpegApiEnabled;
|
||||
@JsonKey(name: 'ffmpeg_binary_enabled')
|
||||
@@ -32,6 +37,9 @@ class ServerStatus {
|
||||
final MeilisearchInfo? meilisearch;
|
||||
@JsonKey(name: 'no_user')
|
||||
final bool noUser;
|
||||
factory ServerStatus.fromJson(Map<String, dynamic> json) => _$ServerStatusFromJson(json);
|
||||
|
||||
factory ServerStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServerStatusFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServerStatusToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user