mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-01-14 06:09:32 +00:00
chore: run dart format
Some checks are pending
Flutter CI & Release / Test (push) Waiting to run
Flutter CI & Release / Build Android APKs (push) Blocked by required conditions
Flutter CI & Release / build_linux (push) Blocked by required conditions
Flutter CI & Release / Create GitHub Release (push) Blocked by required conditions
Some checks are pending
Flutter CI & Release / Test (push) Waiting to run
Flutter CI & Release / Build Android APKs (push) Blocked by required conditions
Flutter CI & Release / build_linux (push) Blocked by required conditions
Flutter CI & Release / Create GitHub Release (push) Blocked by required conditions
This commit is contained in:
parent
a520136e01
commit
e23c0b6c5f
84 changed files with 1565 additions and 1945 deletions
|
|
@ -13,10 +13,7 @@ extension TitleCase on Enum {
|
|||
String get pascalCase {
|
||||
// capitalize the first letter of each word
|
||||
return name
|
||||
.replaceAllMapped(
|
||||
RegExp(r'([A-Z])'),
|
||||
(match) => ' ${match.group(0)}',
|
||||
)
|
||||
.replaceAllMapped(RegExp(r'([A-Z])'), (match) => ' ${match.group(0)}')
|
||||
.trim()
|
||||
.split(' ')
|
||||
.map((word) => word[0].toUpperCase() + word.substring(1))
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ extension ShelfConversion on Shelf {
|
|||
|
||||
extension UserConversion on User {
|
||||
UserWithSessionAndMostRecentProgress
|
||||
get asUserWithSessionAndMostRecentProgress =>
|
||||
UserWithSessionAndMostRecentProgress.fromJson(toJson());
|
||||
get asUserWithSessionAndMostRecentProgress =>
|
||||
UserWithSessionAndMostRecentProgress.fromJson(toJson());
|
||||
User get asUser => User.fromJson(toJson());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,9 +80,7 @@ extension ObfuscateServer on AudiobookShelfServer {
|
|||
if (!kReleaseMode) {
|
||||
return this;
|
||||
}
|
||||
return copyWith(
|
||||
serverUrl: serverUrl.obfuscate(),
|
||||
);
|
||||
return copyWith(serverUrl: serverUrl.obfuscate());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -103,10 +101,7 @@ extension ObfuscateRequest on http.BaseRequest {
|
|||
if (!kReleaseMode) {
|
||||
return this;
|
||||
}
|
||||
return http.Request(
|
||||
method,
|
||||
url.obfuscate(),
|
||||
);
|
||||
return http.Request(method, url.obfuscate());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -134,9 +129,11 @@ extension ObfuscateResponse on http.Response {
|
|||
// token regex is `"token": "..."`
|
||||
return body
|
||||
.replaceAll(
|
||||
RegExp(r'(\b\w+@\w+\.\w+\b)|'
|
||||
r'(\b\d{3}-\d{3}-\d{4}\b)|'
|
||||
r'(\bhttps?://\S+\b)'),
|
||||
RegExp(
|
||||
r'(\b\w+@\w+\.\w+\b)|'
|
||||
r'(\b\d{3}-\d{3}-\d{4}\b)|'
|
||||
r'(\bhttps?://\S+\b)',
|
||||
),
|
||||
'obfuscated',
|
||||
)
|
||||
.replaceAll(
|
||||
|
|
@ -151,9 +148,7 @@ extension ObfuscateLoginResponse on shelfsdk.LoginResponse {
|
|||
if (!kReleaseMode) {
|
||||
return this;
|
||||
}
|
||||
return copyWith(
|
||||
user: user.obfuscate(),
|
||||
);
|
||||
return copyWith(user: user.obfuscate());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -162,8 +157,6 @@ extension ObfuscateUser on shelfsdk.User {
|
|||
if (!kReleaseMode) {
|
||||
return this;
|
||||
}
|
||||
return shelfsdk.User.fromJson(
|
||||
toJson()..['token'] = 'tokenObfuscated',
|
||||
);
|
||||
return shelfsdk.User.fromJson(toJson()..['token'] = 'tokenObfuscated');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
extension ToTimeOfDay on Duration {
|
||||
TimeOfDay toTimeOfDay() {
|
||||
return TimeOfDay(
|
||||
hour: inHours % 24,
|
||||
minute: inMinutes % 60,
|
||||
);
|
||||
return TimeOfDay(hour: inHours % 24, minute: inMinutes % 60);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue