Skip to content

An open-source cross-platform alternative to AirDrop

feat: add unsecured http mode for better debugging

Tien Do Nam679e84a18cdc
diff --git a/assets/i18n/strings.i18n.json b/assets/i18n/strings.i18n.json
index 47ac4e7e..1cec2532 100644
--- a/assets/i18n/strings.i18n.json
+++ b/assets/i18n/strings.i18n.json
@@ -93,7 +93,9 @@
"needRestart": "Restart the server to apply the settings!",
"server": "Server",
"alias": "Alias",
- "port": "Port"
+ "port": "Port",
+ "portWarning": "You might not be detected by other devices because you are using a custom port. (default: {defaultPort})",
+ "encryption": "Encryption"
}
},
"selectedFilesPage": {
@@ -224,6 +226,10 @@
"title": "Cancel file transfer",
"content": "Do you really want to cancel the file transfer?"
},
+ "encryptionDisabledNotice": {
+ "title": "Encryption disabled",
+ "content": "Communication now takes place via the unencrypted HTTP protocol. To use HTTPS, enable encryption again."
+ },
"fileNameInput": {
"title": "Enter file name",
"original": "Original: {original}"
diff --git a/assets/i18n/strings_de.i18n.json b/assets/i18n/strings_de.i18n.json
index b9d3ab00..97d2d31a 100644
--- a/assets/i18n/strings_de.i18n.json
+++ b/assets/i18n/strings_de.i18n.json
@@ -93,7 +93,9 @@
"needRestart": "Starte den Server neu, um die Änderungen zu übernehmen!",
"server": "Server",
"alias": "Alias",
- "port": "Port"
+ "port": "Port",
+ "portWarning": "Möglicherweise wirst du von anderen Geräten nicht erkannt, weil du einen benutzerdefinierten Port verwendest. (Standard: {defaultPort})",
+ "encryption": "Verschlüsselung"
}
},
"selectedFilesPage": {
@@ -156,6 +158,10 @@
"title": "Dateiübertragung abbrechen",
"content": "Möchtest du wirklich die Dateiübertragung abbrechen?"
},
+ "encryptionDisabledNotice": {
+ "title": "Verschlüsselung deaktiviert",
+ "content": "Die Kommunikation erfolgt nun über das unverschlüsselte HTTP-Protokoll. Um HTTPS zu verwenden, aktiviere wieder die Verschlüsselung."
+ },
"fileNameInput": {
"title": "Dateiname eingeben",
"original": "Original: {original}"
diff --git a/lib/constants.dart b/lib/constants.dart
new file mode 100644
index 00000000..ca2ad51e
--- /dev/null
+++ b/lib/constants.dart
@@ -0,0 +1 @@
+const defaultPort = 53317;
diff --git a/lib/init.dart b/lib/init.dart
index bbe2ab9b..653630a3 100644
--- a/lib/init.dart
+++ b/lib/init.dart
@@ -73,7 +73,7 @@ Future<PersistenceService> preInit(List<String> args) async {
final dio = createDio(DioType.startupCheckAnotherInstance);
try {
- await dio.post(ApiRoute.show.targetRaw('127.0.0.1', persistenceService.getPort()), queryParameters: {
+ await dio.post(ApiRoute.show.targetRaw('127.0.0.1', persistenceService.getPort(), persistenceService.isHttps()), queryParameters: {
'token': persistenceService.getShowToken(),
});
exit(0); // Another instance does exist because no error is thrown
@@ -105,6 +105,7 @@ Future<void> postInit(BuildContext context, WidgetRef ref, bool appStart, void F
await ref.read(serverProvider.notifier).startServer(
alias: settings.alias,
port: settings.port,
+ https: settings.https,
);
} catch (e) {
context.showSnackBar(e.toString());
diff --git a/lib/model/device.dart b/lib/model/device.dart
index 1d62f376..338ac44f 100644
--- a/lib/model/device.dart
+++ b/lib/model/device.dart
@@ -19,6 +19,7 @@ class Device with _$Device {
const factory Device({
required String ip,
required int port,
+ required bool https,
required String alias,
required String? deviceModel,
required DeviceType deviceType,
diff --git a/lib/model/dto/info_dto.dart b/lib/model/dto/info_dto.dart
index e8d5adc3..dab21c8c 100644
--- a/lib/model/dto/info_dto.dart
+++ b/lib/model/dto/info_dto.dart
@@ -16,10 +16,11 @@ class InfoDto with _$InfoDto {
}
extension InfoToDeviceExt on InfoDto {
- Device toDevice(String ip, int port) {
+ Device toDevice(String ip, int port, bool https) {
return Device(
ip: ip,
port: port,
+ https: https,
alias: alias,
deviceModel: deviceModel,
deviceType: deviceType,
diff --git a/lib/model/server/server_state.dart b/lib/model/server/server_state.dart
index 52971a43..1686e98c 100644
--- a/lib/model/server/server_state.dart
+++ b/lib/model/server/server_state.dart
@@ -11,6 +11,7 @@ class ServerState with _$ServerState {
required HttpServer httpServer,
required String alias,
required int port,
+ required bool https,
required ReceiveState? receiveState,
}) = _ServerState;
}
diff --git a/lib/model/settings.dart b/lib/model/settings.dart
index c1756977..a5bed657 100644
--- a/lib/model/settings.dart
+++ b/lib/model/settings.dart
@@ -17,5 +17,6 @@ class Settings with _$Settings {
required bool quickSave, // automatically accept file requests
required bool minimizeToTray, // minimize to tray instead of exiting the app
required bool autoStartLaunchMinimized, // start hidden in tray (only available when launchAtStartup is true)
+ required bool https,
}) = _Settings;
}
diff --git a/lib/pages/tabs/send_tab.dart b/lib/pages/tabs/send_tab.dart
index d0ffb0ed..fbb1cb4c 100644
--- a/lib/pages/tabs/send_tab.dart
+++ b/lib/pages/tabs/send_tab.dart
@@ -46,8 +46,10 @@ class _SendTabState extends ConsumerState<SendTab> {
void _scan(String? localIp) {
if (localIp != null) {
- final port = ref.read(settingsProvider.select((settings) => settings.port));
- ref.read(nearbyDevicesProvider.notifier).startScan(port: port, localIp: localIp);
+ final settings = ref.read(settingsProvider);
+ final port = settings.port;
+ final https = settings.https;
+ ref.read(nearbyDevicesProvider.notifier).startScan(port: port, localIp: localIp, https: https);
} else {
ref.read(networkInfoProvider.notifier).scanWhenInitialized();
}
diff --git a/lib/pages/tabs/settings_tab.dart b/lib/pages/tabs/settings_tab.dart
index fa065e77..129232e6 100644
--- a/lib/pages/tabs/settings_tab.dart
+++ b/lib/pages/tabs/settings_tab.dart
@@ -1,6 +1,7 @@
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:localsend_app/constants.dart';
import 'package:localsend_app/gen/strings.g.dart';
import 'package:localsend_app/pages/about_page.dart';
import 'package:localsend_app/pages/changelog_page.dart';
@@ -13,6 +14,7 @@ import 'package:localsend_app/util/platform_check.dart';
import 'package:localsend_app/util/sleep.dart';
import 'package:localsend_app/util/snackbar.dart';
import 'package:localsend_app/widget/custom_dropdown_button.dart';
+import 'package:localsend_app/widget/dialogs/encryption_disabled_notice.dart';
import 'package:localsend_app/widget/dialogs/quick_save_notice.dart';
import 'package:localsend_app/widget/local_send_logo.dart';
import 'package:localsend_app/widget/responsive_list_view.dart';
@@ -193,7 +195,8 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {
title: t.settingsTab.network.title,
children: [
AnimatedCrossFade(
- crossFadeState: serverState != null && (serverState.alias != settings.alias || serverState.port != settings.port)
+ crossFadeState: serverState != null &&
+ (serverState.alias != settings.alias || serverState.port != settings.port || serverState.https != settings.https)
? CrossFadeState.showSecond
: CrossFadeState.showFirst,
duration: const Duration(milliseconds: 200),
@@ -201,7 +204,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {
firstChild: Container(),
secondChild: Padding(
padding: const EdgeInsets.only(bottom: 15),
- child: Text(t.settingsTab.network.needRestart, style: const TextStyle(fontSize: 16, color: Colors.orange)),
+ child: Text(t.settingsTab.network.needRestart, style: const TextStyle(color: Colors.orange)),
),
),
_SettingsEntry(
@@ -224,6 +227,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {
await ref.read(serverProvider.notifier).startServer(
alias: settings.alias,
port: settings.port,
+ https: settings.https,
);
} catch (e) {
context.showSnackBar(e.toString());
@@ -242,6 +246,7 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {
final newServerState = await ref.read(serverProvider.notifier).restartServer(
alias: settings.alias,
port: settings.port,
+ https: settings.https,
);
if (newServerState != null) {
@@ -297,6 +302,29 @@ class _SettingsTabState extends ConsumerState<SettingsTab> {
},
),
),
+ _BooleanEntry(
+ label: t.settingsTab.network.encryption,
+ value: settings.https,
+ onChanged: (b) async {
+ final old = settings.https;
+ await ref.read(settingsProvider.notifier).setHttps(b);
+ if (old && !b && mounted) {
+ EncryptionDisabledNotice.open(context);
+ }
+ },
+ ),
+ AnimatedCrossFade(
+ crossFadeState: settings.port != defaultPort
+ ? CrossFadeState.showSecond
+ : CrossFadeState.showFirst,
+ duration: const Duration(milliseconds: 200),
+ alignment: Alignment.topLeft,
+ firstChild: Container(),
+ secondChild: Padding(
+ padding: const EdgeInsets.only(bottom: 15),
+ child: Text(t.settingsTab.network.portWarning(defaultPort: defaultPort), style: const TextStyle(color: Colors.grey)),
+ ),
+ ),
],
),
Theme(
diff --git a/lib/provider/device_info_provider.dart b/lib/provider/device_info_provider.dart
index 842dd708..c14c7d15 100644
--- a/lib/provider/device_info_provider.dart
+++ b/lib/provider/device_info_provider.dart
@@ -17,6 +17,7 @@ final deviceInfoProvider = Provider((ref) {
ip: networkInfo.localIps.firstOrNull ?? '-',
port: serverState?.port ?? -1,
alias: serverState?.alias ?? '-',
+ https: serverState?.https ?? true,
deviceModel: rawInfo.deviceModel,
deviceType: rawInfo.deviceType,
);
diff --git a/lib/provider/network/nearby_devices_provider.dart b/lib/provider/network/nearby_devices_provider.dart
index 45289f4e..4a1a4c6d 100644
--- a/lib/provider/network/nearby_devices_provider.dart
+++ b/lib/provider/network/nearby_devices_provider.dart
@@ -22,7 +22,7 @@ class NearbyDevicesNotifier extends StateNotifier<NearbyDevicesState> {
NearbyDevicesNotifier(this._dio, this._fingerprint) : super(const NearbyDevicesState(runningIps: {}, devices: {}));
- Future<void> startScan({required int port, required String localIp}) async {
+ Future<void> startScan({required int port, required String localIp, required bool https}) async {
if (state.runningIps.contains(localIp)) {
// already running for the same localIp
return;
@@ -30,7 +30,7 @@ class NearbyDevicesNotifier extends StateNotifier<NearbyDevicesState> {
state = state.copyWith(runningIps: {...state.runningIps, localIp});
- await _getStream(localIp, port, _fingerprint).forEach((device) {
+ await _getStream(localIp, port, https, _fingerprint).forEach((device) {
state = state.copyWith(
devices: {...state.devices}..update(device.ip, (_) => device, ifAbsent: () => device),
);
@@ -39,13 +39,13 @@ class NearbyDevicesNotifier extends StateNotifier<NearbyDevicesState> {
state = state.copyWith(runningIps: state.runningIps.where((ip) => ip != localIp).toSet());
}
- Stream<Device> _getStream(String localIp, int port, String fingerprint) {
+ Stream<Device> _getStream(String localIp, int port, bool https, String fingerprint) {
final ipList = List.generate(256, (i) => '${localIp.split('.').take(3).join('.')}.$i').where((ip) => ip != localIp).toList();
_runners[localIp]?.stop();
_runners[localIp] = TaskRunner<Device?>(
initialTasks: List.generate(
ipList.length,
- (index) => () => _doRequest(_dio, ipList[index], port, fingerprint),
+ (index) => () => _doRequest(_dio, ipList[index], port, https, fingerprint),
),
concurrency: 50,
);
@@ -54,16 +54,16 @@ class NearbyDevicesNotifier extends StateNotifier<NearbyDevicesState> {
}
}
-Future<Device?> _doRequest(Dio dio, String currentIp, int port, String fingerprint) async {
+Future<Device?> _doRequest(Dio dio, String currentIp, int port, bool https, String fingerprint) async {
print('Requesting $currentIp');
- final url = ApiRoute.info.targetRaw(currentIp, port);
+ final url = ApiRoute.info.targetRaw(currentIp, port, https);
Device? device;
try {
final response = await dio.get(url, queryParameters: {
'fingerprint': fingerprint,
});
final dto = InfoDto.fromJson(response.data);
- device = dto.toDevice(currentIp, port);
+ device = dto.toDevice(currentIp, port, https);
} on DioError catch (_) {
device = null;
// print('$url: ${e.error}');
diff --git a/lib/provider/network/server_provider.dart b/lib/provider/network/server_provider.dart
index aa4cc855..cda2a059 100644
--- a/lib/provider/network/server_provider.dart
+++ b/lib/provider/network/server_provider.dart
@@ -4,6 +4,7 @@ import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:localsend_app/constants.dart';
import 'package:localsend_app/model/dto/info_dto.dart';
import 'package:localsend_app/model/dto/send_request_dto.dart';
import 'package:localsend_app/model/file_status.dart';
@@ -16,7 +17,6 @@ import 'package:localsend_app/pages/progress_page.dart';
import 'package:localsend_app/pages/receive_page.dart';
import 'package:localsend_app/provider/device_info_provider.dart';
import 'package:localsend_app/provider/fingerprint_provider.dart';
-import 'package:localsend_app/provider/persistence_provider.dart';
import 'package:localsend_app/provider/progress_provider.dart';
import 'package:localsend_app/provider/settings_provider.dart';
import 'package:localsend_app/util/alias_generator.dart';
@@ -49,7 +49,7 @@ class ServerNotifier extends StateNotifier<ServerState?> {
ServerNotifier(this._ref, this.deviceInfo) : super(null);
- Future<ServerState?> startServer({required String alias, required int port}) async {
+ Future<ServerState?> startServer({required String alias, required int port, required bool https}) async {
if (state != null) {
print('Server already running.');
return null;
@@ -69,6 +69,7 @@ class ServerNotifier extends StateNotifier<ServerState?> {
router: router,
alias: alias,
port: port,
+ https: https,
fingerprint: _ref.read(fingerprintProvider),
showToken: _ref.read(settingsProvider.select((s) => s.showToken)),
);
@@ -76,18 +77,29 @@ class ServerNotifier extends StateNotifier<ServerState?> {
print('Starting server...');
ServerState? newServerState;
- final securityContextResult = generateSecurityContext();
-
- newServerState = ServerState(
- httpServer: await serve(router, '0.0.0.0', port,
- securityContext: SecurityContext()
- ..usePrivateKeyBytes(securityContextResult.privateKey.codeUnits)
- ..useCertificateChainBytes(securityContextResult.certificate.codeUnits)),
- alias: alias,
- port: port,
- receiveState: null,
- );
- print('Server started. (Port: ${newServerState.port})');
+ if (https) {
+ final securityContextResult = generateSecurityContext();
+ newServerState = ServerState(
+ httpServer: await serve(router, '0.0.0.0', port,
+ securityContext: SecurityContext()
+ ..usePrivateKeyBytes(securityContextResult.privateKey.codeUnits)
+ ..useCertificateChainBytes(securityContextResult.certificate.codeUnits)),
+ alias: alias,
+ port: port,
+ https: true,
+ receiveState: null,
+ );
+ print('Server started. (Port: ${newServerState.port}, HTTPS only)');
+ } else {
+ newServerState = ServerState(
+ httpServer: await serve(router, '0.0.0.0', port),
+ alias: alias,
+ port: port,
+ https: false,
+ receiveState: null,
+ );
+ print('Server started. (Port: ${newServerState.port}, HTTP only)');
+ }
state = newServerState;
return newServerState;
@@ -97,6 +109,7 @@ class ServerNotifier extends StateNotifier<ServerState?> {
required Router router,
required String alias,
required int port,
+ required bool https,
required String fingerprint,
required String showToken,
}) {
@@ -154,7 +167,7 @@ class ServerNotifier extends StateNotifier<ServerState?> {
state = state!.copyWith(
receiveState: ReceiveState(
status: SessionStatus.waiting,
- sender: dto.info.toDevice(request.ip, port),
+ sender: dto.info.toDevice(request.ip, port, https),
files: {
for (final file in dto.files.values)
file.id: ReceivingFile(
@@ -385,9 +398,9 @@ class ServerNotifier extends StateNotifier<ServerState?> {
print('Server stopped.');
}
- Future<ServerState?> restartServer({required String alias, required int port}) async {
+ Future<ServerState?> restartServer({required String alias, required int port, required bool https}) async {
await stopServer();
- return await startServer(alias: alias, port: port);
+ return await startServer(alias: alias, port: port, https: https);
}
void acceptFileRequest(Map<String, String> fileNameMap) {
diff --git a/lib/provider/network/targeted_discovery_provider.dart b/lib/provider/network/targeted_discovery_provider.dart
index d3e61033..11438219 100644
--- a/lib/provider/network/targeted_discovery_provider.dart
+++ b/lib/provider/network/targeted_discovery_provider.dart
@@ -19,15 +19,15 @@ class TargetedDiscoveryService {
TargetedDiscoveryService(this._dio, this._fingerprint);
- Future<Device?> discover(String ip, int port) async {
- final url = ApiRoute.info.targetRaw(ip, port);
+ Future<Device?> discover(String ip, int port, bool https) async {
+ final url = ApiRoute.info.targetRaw(ip, port, https);
Device? device;
try {
final response = await _dio.get(url, queryParameters: {
'fingerprint': _fingerprint,
});
final dto = InfoDto.fromJson(response.data);
- device = dto.toDevice(ip, port);
+ device = dto.toDevice(ip, port, https);
} on DioError catch (e) {
device = null;
print('$url: ${e.error}');
diff --git a/lib/provider/network_info_provider.dart b/lib/provider/network_info_provider.dart
index af7ec073..2fc44b47 100644
--- a/lib/provider/network_info_provider.dart
+++ b/lib/provider/network_info_provider.dart
@@ -76,9 +76,15 @@ class NetworkInfoNotifier extends StateNotifier<NetworkInfo> {
return;
}
- final port = _ref.read(settingsProvider.select((settings) => settings.port));
+ final settings = _ref.read(settingsProvider);
+ final port = settings.port;
+ final https = settings.https;
state = state.copyWith(scanWhenInitialized: false);
- await _ref.read(nearbyDevicesProvider.notifier).startScan(port: port, localIp: localIp);
+ await _ref.read(nearbyDevicesProvider.notifier).startScan(
+ port: port,
+ localIp: localIp,
+ https: https,
+ );
}
Future<List<String>> _getIp() async {
diff --git a/lib/provider/persistence_provider.dart b/lib/provider/persistence_provider.dart
index df74dcea..b4d309dc 100644
--- a/lib/provider/persistence_provider.dart
+++ b/lib/provider/persistence_provider.dart
@@ -1,6 +1,7 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
+import 'package:localsend_app/constants.dart';
import 'package:localsend_app/gen/strings.g.dart';
import 'package:localsend_app/util/alias_generator.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -20,8 +21,7 @@ const _saveToGallery = 'ls_save_to_gallery';
const _quickSave = 'ls_quick_save';
const _minimizeToTray = 'ls_minimize_to_tray';
const _autoStartLaunchMinimized = 'ls_auto_start_launch_minimized';
-
-const defaultPort = 53317;
+const _https = 'ls_https';
/// This service abstracts the persistence layer.
class PersistenceService {
@@ -138,4 +138,12 @@ class PersistenceService {
Future<void> setAutoStartLaunchMinimized(bool launchMinimized) async {
await _prefs.setBool(_autoStartLaunchMinimized, launchMinimized);
}
+
+ bool isHttps() {
+ return _prefs.getBool(_https) ?? true;
+ }
+
+ Future<void> setHttps(bool https) async {
+ await _prefs.setBool(_https, https);
+ }
}
diff --git a/lib/provider/settings_provider.dart b/lib/provider/settings_provider.dart
index 1ec0fa95..00f45fe1 100644
--- a/lib/provider/settings_provider.dart
+++ b/lib/provider/settings_provider.dart
@@ -26,6 +26,7 @@ class SettingsNotifier extends StateNotifier<Settings> {
quickSave: service.isQuickSave(),
minimizeToTray: service.isMinimizeToTray(),
autoStartLaunchMinimized: service.isAutoStartLaunchMinimized(),
+ https: service.isHttps(),
);
}
@@ -91,4 +92,11 @@ class SettingsNotifier extends StateNotifier<Settings> {
autoStartLaunchMinimized: launchMinimized,
);
}
+
+ Future<void> setHttps(bool https) async {
+ await _service.setHttps(https);
+ state = state.copyWith(
+ https: https,
+ );
+ }
}
diff --git a/lib/util/api_route_builder.dart b/lib/util/api_route_builder.dart
index 1b7e38f2..024852b0 100644
--- a/lib/util/api_route_builder.dart
+++ b/lib/util/api_route_builder.dart
@@ -25,5 +25,5 @@ enum ApiRoute {
}
/// The client url for polling
- String targetRaw(String ip, int port) => 'https://$ip:$port$path';
+ String targetRaw(String ip, int port, bool https) => '${https ? 'https' : 'http'}://$ip:$port$path';
}
diff --git a/lib/widget/dialogs/address_input_dialog.dart b/lib/widget/dialogs/address_input_dialog.dart
index 98371e8c..a76f8e88 100644
--- a/lib/widget/dialogs/address_input_dialog.dart
+++ b/lib/widget/dialogs/address_input_dialog.dart
@@ -50,10 +50,11 @@ class _AddressInputDialogState extends ConsumerState<AddressInputDialog> {
_fetching = true;
});
+ final https = ref.read(settingsProvider.select((s) => s.https));
final results = TaskRunner<Device?>(
concurrency: 10,
initialTasks: [
- for (final ip in candidates) () => ref.read(targetedDiscoveryProvider).discover(ip, port),
+ for (final ip in candidates) () => ref.read(targetedDiscoveryProvider).discover(ip, port, https),
],
).stream;
diff --git a/lib/widget/dialogs/encryption_disabled_notice.dart b/lib/widget/dialogs/encryption_disabled_notice.dart
new file mode 100644
index 00000000..d5692dfc
--- /dev/null
+++ b/lib/widget/dialogs/encryption_disabled_notice.dart
@@ -0,0 +1,43 @@
+import 'package:flutter/material.dart';
+import 'package:localsend_app/gen/strings.g.dart';
+import 'package:localsend_app/util/platform_check.dart';
+import 'package:localsend_app/widget/dialogs/custom_bottom_sheet.dart';
+import 'package:routerino/routerino.dart';
+
+class EncryptionDisabledNotice extends StatelessWidget {
+ const EncryptionDisabledNotice({Key? key}) : super(key: key);
+
+ static void open(BuildContext context) {
+ if (checkPlatformIsDesktop()) {
+ showDialog(
+ context: context,
+ builder: (_) => AlertDialog(
+ title: Text(t.dialogs.encryptionDisabledNotice.title),
+ content: Text(t.dialogs.encryptionDisabledNotice.content),
+ actions: [
+ TextButton(
+ onPressed: () => context.pop(),
+ child: Text(t.general.close),
+ )
+ ],
+ ),
+ );
+ } else {
+ context.pushBottomSheet(() => const EncryptionDisabledNotice());
+ }
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return CustomBottomSheet(
+ title: t.dialogs.encryptionDisabledNotice.title,
+ description: t.dialogs.encryptionDisabledNotice.content,
+ child: Center(
+ child: ElevatedButton(
+ onPressed: () => context.popUntilRoot(),
+ child: Text(t.general.close),
+ ),
+ ),
+ );
+ }
+}
diff --git a/lib/widget/dialogs/quick_save_notice.dart b/lib/widget/dialogs/quick_save_notice.dart
index 6872c1eb..82a2491b 100644
--- a/lib/widget/dialogs/quick_save_notice.dart
+++ b/lib/widget/dialogs/quick_save_notice.dart
@@ -16,9 +16,7 @@ class QuickSaveNotice extends StatelessWidget {
content: Text(t.dialogs.quickSaveNotice.content),
actions: [
TextButton(
- onPressed: () {
- context.pop();
- },
+ onPressed: () => context.pop(),
child: Text(t.general.close),
)
],