style: format code

This commit is contained in:
13574
2023-09-09 23:46:58 +08:00
parent f0878b4c28
commit 88c51a73d4
22 changed files with 183 additions and 132 deletions

View File

@@ -26,6 +26,7 @@ class ApiResult<T> {
return throw error!;
}
}
(int, String) unwrapErr() {
if (ok) {
return throw 'unwrap_err called on ok ApiResult';

View File

@@ -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:

View File

@@ -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);
}