From bd2d83eda8090cf59c6b20dc381771f56230dcfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=9Al=C4=99zak?= Date: Thu, 25 Jun 2026 12:02:24 +0200 Subject: [PATCH 1/2] Update postures.dart --- client/lib/enterprise/postures.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/lib/enterprise/postures.dart b/client/lib/enterprise/postures.dart index d227f3a..f40d3e0 100644 --- a/client/lib/enterprise/postures.dart +++ b/client/lib/enterprise/postures.dart @@ -81,6 +81,7 @@ class DevicePostureData { final Int32Check? windowsSecurityUpdateAgeDays; final StringCheck? linuxKernelVersion; final BoolCheck? deviceIntegrity; + final StringCheck? androidSecurityPatchDate; const DevicePostureData({ required this.defguardClientVersion, @@ -93,6 +94,7 @@ class DevicePostureData { this.windowsSecurityUpdateAgeDays, this.linuxKernelVersion, this.deviceIntegrity, + this.androidSecurityPatchDate, }); factory DevicePostureData.fromJson(Map json) => @@ -158,6 +160,9 @@ Future getPosture() async { linuxKernelVersion: StringCheck.unavailable( UnavailableReason.notApplicable, ), + androidSecurityPatchDate: android.version.securityPatch != null + ? StringCheck.value(android.version.securityPatch!) + : StringCheck.unavailable(UnavailableReason.detectionFailed), ); } @@ -182,6 +187,9 @@ Future getPosture() async { linuxKernelVersion: StringCheck.unavailable( UnavailableReason.notApplicable, ), + androidSecurityPatchDate: StringCheck.unavailable( + UnavailableReason.notApplicable, + ), ); } @@ -203,5 +211,8 @@ Future getPosture() async { UnavailableReason.notApplicable, ), deviceIntegrity: BoolCheck.unavailable(UnavailableReason.notApplicable), + androidSecurityPatchDate: StringCheck.unavailable( + UnavailableReason.notApplicable, + ), ); } From 9e79d8f38c9e83e44ec3c5578fca1ca44e24b8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=9Al=C4=99zak?= Date: Thu, 25 Jun 2026 14:27:03 +0200 Subject: [PATCH 2/2] fix posture error display, ran dart format --- .fvmrc | 3 ++ client/lib/data/db/enums.dart | 3 +- client/lib/data/proxy/config.dart | 6 ++-- client/lib/enterprise/config_update.dart | 27 +++++++----------- client/lib/enterprise/postures.g.dart | 8 ++++++ client/lib/logging.dart | 2 +- client/lib/open/api.dart | 25 +++++++++++------ .../lib/open/riverpod/biometrics_state.dart | 1 - .../riverpod/package_info/package_info.dart | 2 +- client/lib/open/riverpod/plugin/plugin.dart | 2 +- .../add_instance/generate_wireguard.dart | 6 +--- .../screens/instance/instance_screen.dart | 28 +++++++++---------- .../widgets/delete_instance_dialog.dart | 9 +++--- .../open/widgets/buttons/dg_text_button.dart | 5 +++- client/lib/open/widgets/dg_checkbox.dart | 2 +- client/lib/open/widgets/dg_menu.dart | 12 +++++--- client/lib/open/widgets/loading_screen.dart | 2 +- client/lib/router/routes.dart | 27 ++++++------------ client/lib/theme/color.dart | 2 +- client/lib/theme/text.dart | 2 +- client/lib/utils/position.dart | 11 +++----- client/lib/utils/safe_insets.dart | 16 ++++++----- client/lib/utils/update_instance.dart | 5 ++-- client/pubspec.yaml | 2 +- 24 files changed, 107 insertions(+), 101 deletions(-) create mode 100644 .fvmrc diff --git a/.fvmrc b/.fvmrc new file mode 100644 index 0000000..ac62dd3 --- /dev/null +++ b/.fvmrc @@ -0,0 +1,3 @@ +{ + "flutter": "3.38.10" +} \ No newline at end of file diff --git a/client/lib/data/db/enums.dart b/client/lib/data/db/enums.dart index 36b4c07..85c264e 100644 --- a/client/lib/data/db/enums.dart +++ b/client/lib/data/db/enums.dart @@ -101,7 +101,8 @@ enum ClientTrafficPolicy { ClientTrafficPolicy.values.firstWhere((e) => e.value == value); } -class ClientTrafficPolicyConverter extends TypeConverter { +class ClientTrafficPolicyConverter + extends TypeConverter { const ClientTrafficPolicyConverter(); @override diff --git a/client/lib/data/proxy/config.dart b/client/lib/data/proxy/config.dart index 3bc931d..ffdb4d1 100644 --- a/client/lib/data/proxy/config.dart +++ b/client/lib/data/proxy/config.dart @@ -49,8 +49,8 @@ class NetworkInfoResponse { this.token, }); - factory NetworkInfoResponse.fromJson(Map json) => - _$NetworkInfoResponseFromJson(json); + factory NetworkInfoResponse.fromJson(Map json) => + _$NetworkInfoResponseFromJson(json); - Map toJson() => _$NetworkInfoResponseToJson(this); + Map toJson() => _$NetworkInfoResponseToJson(this); } diff --git a/client/lib/enterprise/config_update.dart b/client/lib/enterprise/config_update.dart index f777891..d2360f6 100644 --- a/client/lib/enterprise/config_update.dart +++ b/client/lib/enterprise/config_update.dart @@ -44,8 +44,7 @@ class ConfigurationUpdater extends HookConsumerWidget { ); for (final instance in instances) { talker.debug( - "Auto configuration update started for ${instance.name} (${instance - .id})", + "Auto configuration update started for ${instance.name} (${instance.id})", ); final (responseData, responseStatus, headers) = await proxyApi .pollConfiguration(instance.proxyUrl, instance.poolingToken); @@ -61,8 +60,7 @@ class ConfigurationUpdater extends HookConsumerWidget { headers['defguard-component-version']?.first; if (coreVersionStr == null || proxyVersionStr == null) { talker.error( - "Version headers missing for ${instance - .logName}, treating as unsupported", + "Version headers missing for ${instance.logName}, treating as unsupported", ); versionUnsupportedInstances.add({ 'name': instance.name, @@ -95,9 +93,7 @@ class ConfigurationUpdater extends HookConsumerWidget { } if (responseData == null) { talker.error( - "Auto configuration update failed for ${instance - .logName} ! Update data retrieval failed, status: ${responseStatus ?? - "unknown"}!", + "Auto configuration update failed for ${instance.logName} ! Update data retrieval failed, status: ${responseStatus ?? "unknown"}!", ); continue; } @@ -112,12 +108,7 @@ class ConfigurationUpdater extends HookConsumerWidget { ); if (updateResult != null) { talker.info( - "Instance ${instance - .logName} results: Instance updated: ${updateResult - .instanceChanged} | Locations updated: ${updateResult - .locationsUpdated} | Locations removed: ${updateResult - .locationsRemoved} | Locations added: ${updateResult - .locationsAdded}", + "Instance ${instance.logName} results: Instance updated: ${updateResult.instanceChanged} | Locations updated: ${updateResult.locationsUpdated} | Locations removed: ${updateResult.locationsRemoved} | Locations added: ${updateResult.locationsAdded}", ); if (updateResult.didChange) { final message = getInstanceUpdateMessage( @@ -144,7 +135,7 @@ class ConfigurationUpdater extends HookConsumerWidget { "The following instances have versions that are incompatible with your Defguard Mobile Client and may not work correctly:\n\n"; for (final instance in versionUnsupportedInstances) { message += - "- ${instance['name']}: Defguard Core ${instance['coreVersion']} (expected >=$supportedCoreVersion), Defguard Proxy ${instance['proxyVersion']} (expected >=$supportedProxyVersion)\n"; + "- ${instance['name']}: Defguard Core ${instance['coreVersion']} (expected >=$supportedCoreVersion), Defguard Proxy ${instance['proxyVersion']} (expected >=$supportedProxyVersion)\n"; } message += "\nPlease contact your administrator."; toaster.showInfo( @@ -170,10 +161,12 @@ class ConfigurationUpdater extends HookConsumerWidget { // update when user wakes up application useEffect(() { final timeTick = DateTime.now(); - final afterCooldown = lastConfigUpdate.value == null || + final afterCooldown = + lastConfigUpdate.value == null || (lastConfigUpdate.value != null && - lastConfigUpdate.value!.add(Duration(seconds: 60)).isBefore( - timeTick)); + lastConfigUpdate.value! + .add(Duration(seconds: 60)) + .isBefore(timeTick)); if (lifecycle == AppLifecycleState.resumed && afterCooldown) { lastConfigUpdate.value = timeTick; updateConfiguration(); diff --git a/client/lib/enterprise/postures.g.dart b/client/lib/enterprise/postures.g.dart index f25bdc6..b2903e4 100644 --- a/client/lib/enterprise/postures.g.dart +++ b/client/lib/enterprise/postures.g.dart @@ -94,6 +94,11 @@ DevicePostureData _$DevicePostureDataFromJson( 'device_integrity', (v) => v == null ? null : BoolCheck.fromJson(v as Map), ), + androidSecurityPatchDate: $checkedConvert( + 'android_security_patch_date', + (v) => + v == null ? null : StringCheck.fromJson(v as Map), + ), ); return val; }, @@ -108,6 +113,7 @@ DevicePostureData _$DevicePostureDataFromJson( 'windowsSecurityUpdateAgeDays': 'windows_security_update_age_days', 'linuxKernelVersion': 'linux_kernel_version', 'deviceIntegrity': 'device_integrity', + 'androidSecurityPatchDate': 'android_security_patch_date', }, ); @@ -122,6 +128,7 @@ const _$DevicePostureDataFieldMap = { 'windowsSecurityUpdateAgeDays': 'windows_security_update_age_days', 'linuxKernelVersion': 'linux_kernel_version', 'deviceIntegrity': 'device_integrity', + 'androidSecurityPatchDate': 'android_security_patch_date', }; Map _$DevicePostureDataToJson(DevicePostureData instance) => @@ -136,6 +143,7 @@ Map _$DevicePostureDataToJson(DevicePostureData instance) => 'windows_security_update_age_days': instance.windowsSecurityUpdateAgeDays, 'linux_kernel_version': instance.linuxKernelVersion, 'device_integrity': instance.deviceIntegrity, + 'android_security_patch_date': instance.androidSecurityPatchDate, }; PostureConnectRequest _$PostureConnectRequestFromJson( diff --git a/client/lib/logging.dart b/client/lib/logging.dart index f1284bb..8d26881 100644 --- a/client/lib/logging.dart +++ b/client/lib/logging.dart @@ -1,3 +1,3 @@ import 'package:talker_flutter/talker_flutter.dart'; -final talker = TalkerFlutter.init(); \ No newline at end of file +final talker = TalkerFlutter.init(); diff --git a/client/lib/open/api.dart b/client/lib/open/api.dart index cd03318..2f46fbb 100644 --- a/client/lib/open/api.dart +++ b/client/lib/open/api.dart @@ -5,15 +5,14 @@ import 'package:cookie_jar/cookie_jar.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:dio/dio.dart'; import 'package:dio_cookie_manager/dio_cookie_manager.dart'; -import 'package:native_dio_adapter/native_dio_adapter.dart'; import 'package:mobile/data/db/enums.dart'; import 'package:mobile/data/proto/client_platform_info.pb.dart'; import 'package:mobile/data/proxy/config.dart'; -import 'package:mobile/enterprise/postures.dart'; -import 'package:package_info_plus/package_info_plus.dart'; import 'package:mobile/data/proxy/enrollment.dart'; import 'package:mobile/data/proxy/mfa.dart'; - +import 'package:mobile/enterprise/postures.dart'; +import 'package:native_dio_adapter/native_dio_adapter.dart'; +import 'package:package_info_plus/package_info_plus.dart'; import 'package:talker_dio_logger/talker_dio_logger_interceptor.dart'; import '../logging.dart'; @@ -211,6 +210,13 @@ class _ProxyApi { dataError.toLowerCase().trim() == missingMFAMethodError) { throw MfaMethodNotAvailableException(data.method); } + + if (e.response?.statusCode == 403) { + final error = responseData['error'] ?? responseData['message']; + if (error is String) { + throw HttpException(error); + } + } } throw HttpException( "Failed to start MFA. Status: ${e.response?.statusCode} Body: ${e.response?.data}", @@ -237,11 +243,12 @@ class _ProxyApi { return PostureConnectResponse.fromJson(response.data); } on DioException catch (e) { final responseData = e.response?.data; - final dataError = responseData is Map - ? responseData['error'] - : null; - if (e.response?.statusCode == 403 && dataError is String) { - throw PostureCheckException(dataError); + if (e.response?.statusCode == 403 && + responseData is Map) { + final error = responseData['error'] ?? responseData['message']; + if (error is String) { + throw PostureCheckException(error); + } } if (e.response != null) { throw HttpException( diff --git a/client/lib/open/riverpod/biometrics_state.dart b/client/lib/open/riverpod/biometrics_state.dart index 8b5ddd6..7c5421a 100644 --- a/client/lib/open/riverpod/biometrics_state.dart +++ b/client/lib/open/riverpod/biometrics_state.dart @@ -7,7 +7,6 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; part 'biometrics_state.g.dart'; - class BiometricsState { bool isSupported; bool canCheck; diff --git a/client/lib/open/riverpod/package_info/package_info.dart b/client/lib/open/riverpod/package_info/package_info.dart index bf6a28e..d46691a 100644 --- a/client/lib/open/riverpod/package_info/package_info.dart +++ b/client/lib/open/riverpod/package_info/package_info.dart @@ -10,4 +10,4 @@ Future packageInfo(Ref ref) async { WidgetsFlutterBinding.ensureInitialized(); final info = await PackageInfo.fromPlatform(); return info; -} \ No newline at end of file +} diff --git a/client/lib/open/riverpod/plugin/plugin.dart b/client/lib/open/riverpod/plugin/plugin.dart index 2d7b177..4f2f6e0 100644 --- a/client/lib/open/riverpod/plugin/plugin.dart +++ b/client/lib/open/riverpod/plugin/plugin.dart @@ -15,4 +15,4 @@ class PluginActiveTunnelState extends _$PluginActiveTunnelState { void clear() { state = null; } -} \ No newline at end of file +} diff --git a/client/lib/open/screens/add_instance/generate_wireguard.dart b/client/lib/open/screens/add_instance/generate_wireguard.dart index f9cd791..61c7d5d 100644 --- a/client/lib/open/screens/add_instance/generate_wireguard.dart +++ b/client/lib/open/screens/add_instance/generate_wireguard.dart @@ -3,14 +3,10 @@ import 'dart:convert'; import 'package:mobile/data/proxy/enrollment.dart'; import 'package:x25519/x25519.dart' as x; - Future generateWireguardKeyPair() async { final keyPair = x.generateKeyPair(); final encodedPriv = base64Encode(keyPair.privateKey); final encodedPub = base64Encode(keyPair.publicKey); - return WireguardEncodedKeyPair( - privKey: encodedPriv, - pubKey: encodedPub, - ); + return WireguardEncodedKeyPair(privKey: encodedPriv, pubKey: encodedPub); } diff --git a/client/lib/open/screens/instance/instance_screen.dart b/client/lib/open/screens/instance/instance_screen.dart index a725ec5..310acef 100644 --- a/client/lib/open/screens/instance/instance_screen.dart +++ b/client/lib/open/screens/instance/instance_screen.dart @@ -415,20 +415,20 @@ class _LocationItem extends HookConsumerWidget { ); }, ), - if (instance.clientTrafficPolicy == ClientTrafficPolicy.none) - DgMenuItem( - text: "Select Traffic Routing", - onTap: () { - showDialog( - context: context, - builder: (_) => RoutingMethodDialog( - location: location, - intention: RoutingMethodDialogIntention.save, - clientTrafficPolicy: instance.clientTrafficPolicy, - ), - ); - }, - ), + if (instance.clientTrafficPolicy == ClientTrafficPolicy.none) + DgMenuItem( + text: "Select Traffic Routing", + onTap: () { + showDialog( + context: context, + builder: (_) => RoutingMethodDialog( + location: location, + intention: RoutingMethodDialogIntention.save, + clientTrafficPolicy: instance.clientTrafficPolicy, + ), + ); + }, + ), ]; }, [location, instance]); diff --git a/client/lib/open/screens/instance/widgets/delete_instance_dialog.dart b/client/lib/open/screens/instance/widgets/delete_instance_dialog.dart index 26976d6..e60477d 100644 --- a/client/lib/open/screens/instance/widgets/delete_instance_dialog.dart +++ b/client/lib/open/screens/instance/widgets/delete_instance_dialog.dart @@ -10,7 +10,6 @@ import 'package:mobile/utils/secure_storage.dart'; import '../../../services/snackbar_service.dart'; - class DeleteInstanceDialog extends HookConsumerWidget { final DefguardInstance instance; @@ -25,7 +24,7 @@ class DeleteInstanceDialog extends HookConsumerWidget { Future deleteInstance(BuildContext context) async { try { - if(instance.mfaKeysStored) { + if (instance.mfaKeysStored) { await removeInstanceStorage(instance.secureStorageKey); } await db.managers.defguardInstances @@ -35,8 +34,10 @@ class DeleteInstanceDialog extends HookConsumerWidget { SnackbarService.show("Instance deleted"); Navigator.of(context).pop(); } - } catch(e) { - talker.error("Failed to delete instance ${instance.logName}! Reason: \n $e"); + } catch (e) { + talker.error( + "Failed to delete instance ${instance.logName}! Reason: \n $e", + ); } } diff --git a/client/lib/open/widgets/buttons/dg_text_button.dart b/client/lib/open/widgets/buttons/dg_text_button.dart index 72d43ad..297078f 100644 --- a/client/lib/open/widgets/buttons/dg_text_button.dart +++ b/client/lib/open/widgets/buttons/dg_text_button.dart @@ -39,7 +39,10 @@ class DgTextButton extends StatelessWidget { child: Text( text, textAlign: TextAlign.center, - style: textStyle.copyWith(decoration: TextDecoration.underline, decorationColor: textStyle.color), + style: textStyle.copyWith( + decoration: TextDecoration.underline, + decorationColor: textStyle.color, + ), ), ), ), diff --git a/client/lib/open/widgets/dg_checkbox.dart b/client/lib/open/widgets/dg_checkbox.dart index 90a7d5e..a71a950 100644 --- a/client/lib/open/widgets/dg_checkbox.dart +++ b/client/lib/open/widgets/dg_checkbox.dart @@ -31,7 +31,7 @@ class DgCheckbox extends StatelessWidget { Widget _getBody() { final icon = DgIconCheckbox(size: iconSize, variant: _getIconVariant()); TextStyle textStyleInner; - if(textStyle == null) { + if (textStyle == null) { textStyleInner = DgText.modal1.copyWith(color: DgColor.textBodySecondary); } else { textStyleInner = textStyle!; diff --git a/client/lib/open/widgets/dg_menu.dart b/client/lib/open/widgets/dg_menu.dart index 651d95e..f6d3c47 100644 --- a/client/lib/open/widgets/dg_menu.dart +++ b/client/lib/open/widgets/dg_menu.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; @@ -31,7 +30,9 @@ class DgMenu extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { - final topOffset = useMemoized(() => anchorGeometry.position.dy + 10 + anchorGeometry.size.height); + final topOffset = useMemoized( + () => anchorGeometry.position.dy + 10 + anchorGeometry.size.height, + ); final leftOffset = useMemoized(() => anchorGeometry.position.dx); final animationController = useAnimationController( duration: 100.ms, @@ -67,8 +68,11 @@ class DgMenu extends HookConsumerWidget { builder: (context, _) => FadeTransition( opacity: animationController, child: SlideTransition( - position: Tween(begin: Offset(0, -0.05), end: Offset.zero) - .animate( + position: + Tween( + begin: Offset(0, -0.05), + end: Offset.zero, + ).animate( CurvedAnimation( parent: animationController, curve: Curves.easeOut, diff --git a/client/lib/open/widgets/loading_screen.dart b/client/lib/open/widgets/loading_screen.dart index a5e1bc5..4ed189a 100644 --- a/client/lib/open/widgets/loading_screen.dart +++ b/client/lib/open/widgets/loading_screen.dart @@ -29,7 +29,7 @@ class LoadingView extends StatelessWidget { mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - DgCircularProgress(color: DgColor.iconSecondary, size: 92), + DgCircularProgress(color: DgColor.iconSecondary, size: 92), ], ), ); diff --git a/client/lib/router/routes.dart b/client/lib/router/routes.dart index 3994ccd..c7c4f22 100644 --- a/client/lib/router/routes.dart +++ b/client/lib/router/routes.dart @@ -21,8 +21,7 @@ part 'routes.g.dart'; @TypedGoRoute(path: "/process_qr") @immutable -class ProcessQrScreenRoute extends GoRouteData - with _$ProcessQrScreenRoute { +class ProcessQrScreenRoute extends GoRouteData with _$ProcessQrScreenRoute { const ProcessQrScreenRoute(this.$extra); final ProcessQrScreenData $extra; @@ -35,8 +34,7 @@ class ProcessQrScreenRoute extends GoRouteData @TypedGoRoute(path: '/') @immutable -class HomeScreenRoute extends GoRouteData - with _$HomeScreenRoute { +class HomeScreenRoute extends GoRouteData with _$HomeScreenRoute { const HomeScreenRoute(); @override @@ -47,8 +45,7 @@ class HomeScreenRoute extends GoRouteData @TypedGoRoute(path: "/qr") @immutable -class QRScreenRoute extends GoRouteData - with _$QRScreenRoute { +class QRScreenRoute extends GoRouteData with _$QRScreenRoute { const QRScreenRoute(this.$extra); final QrScreenData $extra; @@ -61,8 +58,7 @@ class QRScreenRoute extends GoRouteData @TypedGoRoute(path: "/instance/:id") @immutable -class InstanceScreenRoute extends GoRouteData - with _$InstanceScreenRoute { +class InstanceScreenRoute extends GoRouteData with _$InstanceScreenRoute { final String id; const InstanceScreenRoute({required this.id}); @@ -75,8 +71,7 @@ class InstanceScreenRoute extends GoRouteData @TypedGoRoute(path: "/add_instance/name_device") @immutable -class NameDeviceScreenRoute extends GoRouteData - with _$NameDeviceScreenRoute { +class NameDeviceScreenRoute extends GoRouteData with _$NameDeviceScreenRoute { const NameDeviceScreenRoute(this.$extra); final NameDeviceScreenData $extra; @@ -99,8 +94,7 @@ class AddInstanceFormScreenRoute extends GoRouteData @TypedGoRoute(path: '/add_instance/init') @immutable -class AddInstanceScreenRoute extends GoRouteData - with _$AddInstanceScreenRoute { +class AddInstanceScreenRoute extends GoRouteData with _$AddInstanceScreenRoute { const AddInstanceScreenRoute(); @override @@ -111,8 +105,7 @@ class AddInstanceScreenRoute extends GoRouteData @TypedGoRoute(path: "/talker") @immutable -class TalkerScreenRoute extends GoRouteData - with _$TalkerScreenRoute { +class TalkerScreenRoute extends GoRouteData with _$TalkerScreenRoute { @override Widget build(BuildContext context, GoRouterState state) { return TalkerScreen(talker: talker); @@ -121,8 +114,7 @@ class TalkerScreenRoute extends GoRouteData @TypedGoRoute(path: "/mfa/openid") @immutable -class OpenIdMfaScreenRoute extends GoRouteData - with _$OpenIdMfaScreenRoute { +class OpenIdMfaScreenRoute extends GoRouteData with _$OpenIdMfaScreenRoute { const OpenIdMfaScreenRoute(this.$extra); final OpenIdMfaScreenData $extra; @@ -149,8 +141,7 @@ class OpenIdMfaWaitingScreenRoute extends GoRouteData @TypedGoRoute(path: "/mfa/code") @immutable -class MfaCodeScreenRoute extends GoRouteData - with _$MfaCodeScreenRoute { +class MfaCodeScreenRoute extends GoRouteData with _$MfaCodeScreenRoute { const MfaCodeScreenRoute(this.$extra); final MfaCodeScreenData $extra; diff --git a/client/lib/theme/color.dart b/client/lib/theme/color.dart index dac138c..b797de5 100644 --- a/client/lib/theme/color.dart +++ b/client/lib/theme/color.dart @@ -81,4 +81,4 @@ final BoxShadow dgBoxShadow = BoxShadow( offset: Offset(0, 12), blurRadius: 24, spreadRadius: 0, -); \ No newline at end of file +); diff --git a/client/lib/theme/text.dart b/client/lib/theme/text.dart index 2e37da8..484c6dd 100644 --- a/client/lib/theme/text.dart +++ b/client/lib/theme/text.dart @@ -25,7 +25,7 @@ class DgText { static const TextStyle body2 = TextStyle( fontFamily: _poppins, fontWeight: FontWeight.w400, - fontSize: 15 + fontSize: 15, ); static const TextStyle modal1 = TextStyle( fontFamily: _roboto, diff --git a/client/lib/utils/position.dart b/client/lib/utils/position.dart index c09f723..4984d53 100644 --- a/client/lib/utils/position.dart +++ b/client/lib/utils/position.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; Offset? getRenderObjectPosition(RenderObject? renderObject) { - if(renderObject is RenderBox && renderObject.hasSize) { + if (renderObject is RenderBox && renderObject.hasSize) { return renderObject.localToGlobal(Offset.zero); } return null; @@ -11,18 +11,15 @@ class WidgetGeometry { final Offset position; final Size size; - const WidgetGeometry({ - required this.position, - required this.size, - }); + const WidgetGeometry({required this.position, required this.size}); static WidgetGeometry fromKey(GlobalKey key) { final renderObject = key.currentContext?.findRenderObject(); - if(renderObject is RenderBox && renderObject.hasSize) { + if (renderObject is RenderBox && renderObject.hasSize) { final position = renderObject.localToGlobal(Offset.zero); final size = renderObject.size; return WidgetGeometry(position: position, size: size); } return WidgetGeometry(position: Offset.zero, size: Size.zero); } -} \ No newline at end of file +} diff --git a/client/lib/utils/safe_insets.dart b/client/lib/utils/safe_insets.dart index 6bd86a2..cb9b9b7 100644 --- a/client/lib/utils/safe_insets.dart +++ b/client/lib/utils/safe_insets.dart @@ -1,11 +1,13 @@ import 'dart:math' as math; import 'package:flutter/material.dart'; -(double, double) safeInsetHorizontal(BuildContext context, - double preferredPadding) { - final safe = MediaQuery - .of(context) - .padding; - return (math.max(safe.left, preferredPadding), math.max( - safe.right, preferredPadding)); +(double, double) safeInsetHorizontal( + BuildContext context, + double preferredPadding, +) { + final safe = MediaQuery.of(context).padding; + return ( + math.max(safe.left, preferredPadding), + math.max(safe.right, preferredPadding), + ); } diff --git a/client/lib/utils/update_instance.dart b/client/lib/utils/update_instance.dart index 81b079f..5280494 100644 --- a/client/lib/utils/update_instance.dart +++ b/client/lib/utils/update_instance.dart @@ -60,7 +60,8 @@ Future updateInstance({ await db.managers.defguardInstances .filter((row) => row.id.equals(instance.id)) .update( - (_) => DefguardInstancesCompanion(poolingToken: drift.Value(token)), + (_) => + DefguardInstancesCompanion(poolingToken: drift.Value(token)), ); talker.debug("${instance.logName} token updated"); } @@ -124,7 +125,7 @@ String getInstanceUpdateMessage( UpdateInstanceResult updateResult, ) { final buffer = StringBuffer(); - if(updateResult.instanceChanged) { + if (updateResult.instanceChanged) { buffer.write("Instance information updated. "); } if (updateResult.locationsRemoved.isNotEmpty) { diff --git a/client/pubspec.yaml b/client/pubspec.yaml index ac44d0c..cfbb766 100644 --- a/client/pubspec.yaml +++ b/client/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.6.4+1 +version: 1.7.0+1 environment: sdk: ^3.8.1