chore: lint fix
This commit is contained in:
parent
5634b50528
commit
46e2cb6012
|
@ -1 +1 @@
|
|||
Subproject commit 41456452f29d64e8deb623a3c927524bcf9f111b
|
||||
Subproject commit ba393198430278b6595976de84fe170f553cc728
|
|
@ -2,12 +2,12 @@ import 'dart:io';
|
|||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:ente_auth/core/configuration.dart';
|
||||
import 'package:ente_auth/core/constants.dart';
|
||||
import 'package:ente_auth/core/event_bus.dart';
|
||||
import 'package:ente_auth/events/endpoint_updated_event.dart';
|
||||
import 'package:ente_auth/utils/package_info_util.dart';
|
||||
import 'package:ente_auth/utils/platform_util.dart';
|
||||
import 'package:fk_user_agent/fk_user_agent.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
int kConnectTimeout = 15000;
|
||||
|
@ -22,8 +22,6 @@ class Network {
|
|||
final version = PackageInfoUtil().getVersion(packageInfo);
|
||||
final packageName = PackageInfoUtil().getPackageName(packageInfo);
|
||||
|
||||
final preferences = await SharedPreferences.getInstance();
|
||||
|
||||
_dio = Dio(
|
||||
BaseOptions(
|
||||
connectTimeout: Duration(milliseconds: kConnectTimeout),
|
||||
|
@ -39,7 +37,7 @@ class Network {
|
|||
|
||||
_enteDio = Dio(
|
||||
BaseOptions(
|
||||
baseUrl: apiEndpoint,
|
||||
baseUrl: Configuration.endpoint,
|
||||
connectTimeout: Duration(milliseconds: kConnectTimeout),
|
||||
headers: {
|
||||
if (PlatformUtil.isMobile())
|
||||
|
@ -51,7 +49,7 @@ class Network {
|
|||
},
|
||||
),
|
||||
);
|
||||
_setupInterceptors(endpoint);
|
||||
_setupInterceptors(Configuration.endpoint);
|
||||
|
||||
Bus.instance.on<EndpointUpdatedEvent>().listen((event) {
|
||||
final endpoint = Configuration.instance.getHttpEndpoint();
|
||||
|
|
|
@ -42,7 +42,7 @@ void main() async {
|
|||
WindowOptions windowOptions = const WindowOptions(
|
||||
size: Size(450, 800),
|
||||
);
|
||||
windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||
await windowManager.waitUntilReadyToShow(windowOptions, () async {
|
||||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
});
|
||||
|
|
|
@ -210,7 +210,7 @@ class AuthenticatorService {
|
|||
await _db.deleteByIDs(ids: deletedIDs);
|
||||
}
|
||||
await _prefs.setInt(_lastEntitySyncTime, maxSyncTime);
|
||||
_logger.info("Setting synctime to " + maxSyncTime.toString());
|
||||
_logger.info("Setting synctime to $maxSyncTime");
|
||||
if (result.length == fetchLimit) {
|
||||
_logger.info("Diff limit reached, pulling again");
|
||||
await _remoteToLocalSync();
|
||||
|
|
|
@ -27,7 +27,7 @@ class NotificationService {
|
|||
_flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<
|
||||
AndroidFlutterLocalNotificationsPlugin>();
|
||||
if (implementation != null) {
|
||||
implementation.requestNotificationsPermission();
|
||||
await implementation.requestNotificationsPermission();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
final Logger _logger = Logger('_LoginPageState');
|
||||
|
||||
Future<void> onPressed() async {
|
||||
UserService.instance.setEmail(_email!);
|
||||
await UserService.instance.setEmail(_email!);
|
||||
Configuration.instance.resetVolatilePassword();
|
||||
SrpAttributes? attr;
|
||||
bool isEmailVerificationEnabled = true;
|
||||
|
@ -39,7 +39,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
}
|
||||
}
|
||||
if (attr != null && !isEmailVerificationEnabled) {
|
||||
Navigator.of(context).push(
|
||||
await Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return LoginPasswordVerificationPage(
|
||||
|
|
|
@ -254,7 +254,7 @@ class _RecoveryKeyPageState extends State<RecoveryKeyPage> {
|
|||
childrens.add(
|
||||
GradientButton(
|
||||
onTap: () async {
|
||||
shareDialog(
|
||||
await shareDialog(
|
||||
context,
|
||||
context.l10n.recoveryKey,
|
||||
saveAction: () async {
|
||||
|
|
|
@ -24,7 +24,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||
await Configuration.instance.recover(_recoveryKey.text.trim());
|
||||
await dialog.hide();
|
||||
showToast(context, "Recovery successful!");
|
||||
Navigator.of(context).pushReplacement(
|
||||
await Navigator.of(context).pushReplacement(
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return const PopScope(
|
||||
|
@ -42,7 +42,7 @@ class _RecoveryPageState extends State<RecoveryPage> {
|
|||
if (e is AssertionError) {
|
||||
errMessage = '$errMessage : ${e.message}';
|
||||
}
|
||||
showErrorDialog(context, "Incorrect recovery key", errMessage);
|
||||
await showErrorDialog(context, "Incorrect recovery key", errMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ class _VerifyRecoveryPageState extends State<VerifyRecoveryPage> {
|
|||
try {
|
||||
recoveryKey =
|
||||
CryptoUtil.bin2hex(Configuration.instance.getRecoveryKey());
|
||||
routeToPage(
|
||||
await routeToPage(
|
||||
context,
|
||||
RecoveryKeyPage(
|
||||
recoveryKey,
|
||||
|
|
|
@ -158,7 +158,7 @@ class _HomePageState extends State<HomePage> {
|
|||
Navigator.of(context).pop();
|
||||
return;
|
||||
}
|
||||
MoveToBackground.moveTaskToBack();
|
||||
await MoveToBackground.moveTaskToBack();
|
||||
},
|
||||
canPop: false,
|
||||
child: Scaffold(
|
||||
|
|
|
@ -37,7 +37,7 @@ class DataSectionWidget extends StatelessWidget {
|
|||
trailingIcon: Icons.chevron_right_outlined,
|
||||
trailingIconIsMuted: true,
|
||||
onTap: () async {
|
||||
routeToPage(context, const ImportCodePage());
|
||||
await routeToPage(context, const ImportCodePage());
|
||||
},
|
||||
),
|
||||
sectionOptionSpacing,
|
||||
|
|
|
@ -27,7 +27,7 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
_logger.info(
|
||||
"Current endpoint is: " + Configuration.instance.getHttpEndpoint(),
|
||||
"Current endpoint is: ${Configuration.instance.getHttpEndpoint()}",
|
||||
);
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
|
@ -49,7 +49,7 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|||
GradientButton(
|
||||
onTap: () async {
|
||||
String url = _urlController.text;
|
||||
_logger.info("Entered endpoint: " + url);
|
||||
_logger.info("Entered endpoint: $url");
|
||||
try {
|
||||
final uri = Uri.parse(url);
|
||||
if ((uri.scheme == "http" || uri.scheme == "https")) {
|
||||
|
@ -79,7 +79,7 @@ class _DeveloperSettingsPageState extends State<DeveloperSettingsPage> {
|
|||
|
||||
Future<void> _ping(String endpoint) async {
|
||||
try {
|
||||
final response = await Dio().get(endpoint + '/ping');
|
||||
final response = await Dio().get('$endpoint/ping');
|
||||
if (response.data['message'] != 'pong') {
|
||||
throw Exception('Invalid response');
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ class DeveloperSettingsWidget extends StatelessWidget {
|
|||
padding: const EdgeInsets.only(bottom: 20),
|
||||
child: Text(
|
||||
context.l10n.customEndpoint(
|
||||
endpointURI.host + ":" + endpointURI.port.toString(),
|
||||
"${endpointURI.host}:${endpointURI.port}",
|
||||
),
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
),
|
||||
|
|
|
@ -42,7 +42,7 @@ Future<void> sendLogs(
|
|||
String? body,
|
||||
}) async {
|
||||
final l10n = context.l10n;
|
||||
showDialogWidget(
|
||||
await showDialogWidget(
|
||||
context: context,
|
||||
title: title,
|
||||
icon: Icons.bug_report_outlined,
|
||||
|
@ -68,7 +68,7 @@ Future<void> sendLogs(
|
|||
labelText: l10n.viewLogsAction,
|
||||
buttonAction: ButtonAction.second,
|
||||
onTap: () async {
|
||||
showDialog(
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return LogFileViewer(SuperLogging.logFile!);
|
||||
|
@ -101,71 +101,14 @@ Future<void> sendLogs(
|
|||
);
|
||||
},
|
||||
),
|
||||
onPressed: () async {
|
||||
// ignore: unawaited_futures
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return LogFileViewer(SuperLogging.logFile!);
|
||||
},
|
||||
barrierColor: Colors.black87,
|
||||
barrierDismissible: false,
|
||||
);
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.alternativeColor,
|
||||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
Navigator.of(context, rootNavigator: true).pop('dialog');
|
||||
await _sendLogs(context, toEmail, subject, body);
|
||||
if (postShare != null) {
|
||||
postShare();
|
||||
}
|
||||
},
|
||||
),
|
||||
];
|
||||
final List<Widget> content = [];
|
||||
content.addAll(
|
||||
[
|
||||
Text(
|
||||
l10n.sendLogsDescription,
|
||||
style: const TextStyle(
|
||||
height: 1.5,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
const Padding(padding: EdgeInsets.all(12)),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: actions,
|
||||
ButtonWidget(
|
||||
isInAlert: true,
|
||||
buttonType: ButtonType.secondary,
|
||||
labelText: l10n.cancel,
|
||||
buttonAction: ButtonAction.cancel,
|
||||
),
|
||||
],
|
||||
);
|
||||
final confirmation = AlertDialog(
|
||||
title: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
content: SingleChildScrollView(
|
||||
child: ListBody(
|
||||
children: content,
|
||||
),
|
||||
),
|
||||
);
|
||||
// ignore: unawaited_futures
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (_) {
|
||||
return confirmation;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _sendLogs(
|
||||
|
|
|
@ -32,7 +32,7 @@ class PlatformUtil {
|
|||
static openWebView(BuildContext context, String title, String url) async {
|
||||
if (PlatformUtil.isDesktop()) {
|
||||
if (!await WebviewWindow.isWebviewAvailable()) {
|
||||
launchUrlString(url);
|
||||
await launchUrlString(url);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ class PlatformUtil {
|
|||
webview.launch(url);
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).push(
|
||||
await Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (BuildContext context) {
|
||||
return WebPage(
|
||||
|
|
|
@ -13,7 +13,7 @@ Future<void> shareDialog(
|
|||
required Function sendAction,
|
||||
}) async {
|
||||
final l10n = context.l10n;
|
||||
showDialogWidget(
|
||||
await showDialogWidget(
|
||||
context: context,
|
||||
title: title,
|
||||
body: Platform.isLinux || Platform.isWindows
|
||||
|
|
|
@ -213,7 +213,7 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: collection
|
||||
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
|
||||
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.18.0"
|
||||
|
@ -901,26 +901,26 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16"
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "0.8.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
|
||||
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.9.1"
|
||||
version: "1.11.0"
|
||||
mime:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -969,14 +969,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
open_filex:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: open_filex
|
||||
sha256: "74e2280754cf8161e860746c3181db2c996d6c1909c7057b738ede4a469816b8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.4.0"
|
||||
otp:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -1021,10 +1013,10 @@ packages:
|
|||
dependency: "direct main"
|
||||
description:
|
||||
name: path
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
version: "1.9.0"
|
||||
path_drawing:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1419,10 +1411,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: stack_trace
|
||||
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
|
||||
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.11.0"
|
||||
version: "1.11.1"
|
||||
step_progress_indicator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
@ -1435,10 +1427,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: stream_channel
|
||||
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
|
||||
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
version: "2.1.2"
|
||||
stream_transform:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
@ -1483,7 +1475,7 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
|
||||
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
|
@ -1643,10 +1635,10 @@ packages:
|
|||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: c538be99af830f478718b51630ec1b6bee5e74e52c8a802d328d9e71d35d2583
|
||||
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.10.0"
|
||||
version: "13.0.0"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
1
desktop/thirdparty/next-electron-server
vendored
Submodule
1
desktop/thirdparty/next-electron-server
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit a88030295c89dd8f43d9e3a45025678d95c78a45
|
1
mobile/thirdparty/flutter
vendored
Submodule
1
mobile/thirdparty/flutter
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 367f9ea16bfae1ca451b9cc27c1366870b187ae2
|
1
mobile/thirdparty/isar
vendored
Submodule
1
mobile/thirdparty/isar
vendored
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 6643d064abf22606b6c6a741ea873e4781115ef4
|
Loading…
Reference in a new issue