π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[auth] Remove scan package
Aman Raj Singh Mourya1e45ae5bbc9e
diff --git a/auth/lib/ui/home/home_empty_state.dart b/auth/lib/ui/home/home_empty_state.dartindex cb3f2f9d6e..be357463c4 100644--- a/auth/lib/ui/home/home_empty_state.dart+++ b/auth/lib/ui/home/home_empty_state.dart@@ -1,5 +1,4 @@import 'package:ente_auth/l10n/l10n.dart';-import 'package:ente_auth/services/auth_feature_flag.dart';import 'package:ente_auth/theme/ente_theme.dart';import 'package:ente_auth/ui/settings/data/import_page.dart';import 'package:ente_auth/utils/navigation_util.dart';@@ -10,13 +9,11 @@ import 'package:logging/logging.dart';class HomeEmptyStateWidget extends StatelessWidget {final VoidCallback? onScanTap;final VoidCallback? onManuallySetupTap;- final VoidCallback? onImportFromGallery;const HomeEmptyStateWidget({super.key,required this.onScanTap,required this.onManuallySetupTap,- this.onImportFromGallery,});@override@@ -62,23 +59,6 @@ class HomeEmptyStateWidget extends StatelessWidget {),),const SizedBox(height: 18),- if (PlatformUtil.isMobile() &&- FeatureFlagService.instance- .isInternalUserOrDebugBuild())- SizedBox(- width: 400,- child: OutlinedButton(- onPressed: onImportFromGallery,- style: OutlinedButton.styleFrom(- padding: const EdgeInsets.symmetric(vertical: 8),- ),- child: const Text(- "Import from gallery",- textAlign: TextAlign.center,- ),- ),- ),- const SizedBox(height: 18),SizedBox(width: 400,child: OutlinedButton(diff --git a/auth/lib/ui/home_page.dart b/auth/lib/ui/home_page.dartindex f958e0a2d8..8fbf7c0913 100644--- a/auth/lib/ui/home_page.dart+++ b/auth/lib/ui/home_page.dart@@ -14,7 +14,6 @@ import 'package:ente_auth/models/code.dart';import 'package:ente_auth/onboarding/model/tag_enums.dart';import 'package:ente_auth/onboarding/view/common/tag_chip.dart';import 'package:ente_auth/onboarding/view/setup_enter_secret_key_page.dart';-import 'package:ente_auth/services/auth_feature_flag.dart';import 'package:ente_auth/services/preference_service.dart';import 'package:ente_auth/services/user_service.dart';import 'package:ente_auth/store/code_display_store.dart';@@ -40,7 +39,6 @@ import 'package:ente_auth/utils/dialog_util.dart';import 'package:ente_auth/utils/lock_screen_settings.dart';import 'package:ente_auth/utils/platform_util.dart';import 'package:ente_auth/utils/totp_util.dart';-import 'package:file_picker/file_picker.dart';import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';import 'package:flutter/services.dart';@@ -48,7 +46,6 @@ import 'package:flutter_speed_dial/flutter_speed_dial.dart';import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';import 'package:logging/logging.dart';import 'package:move_to_background/move_to_background.dart';-import 'package:scan/scan.dart';class HomePage extends StatefulWidget {const HomePage({super.key});@@ -483,7 +480,6 @@ class _HomePageState extends State<HomePage> {return HomeEmptyStateWidget(onScanTap: _redirectToScannerPage,onManuallySetupTap: _redirectToManualEntryPage,- onImportFromGallery: _importFromGallery,);} else {final anyCodeHasError =@@ -699,29 +695,6 @@ class _HomePageState extends State<HomePage> {_applyFilteringAndRefresh();}- Future<void> _importFromGallery() async {- try {- final FilePickerResult? result = await FilePicker.platform.pickFiles(- type: FileType.image,- allowMultiple: false,- );- if (result != null) {- final path = result.files.single.path!;- String? res = await Scan.parse(path);- final Code? code = res != null ? Code.fromOTPAuthUrl(res) : null;- if (code != null) {- await CodeStore.instance.addCode(code);- if ((_allCodes?.where((e) => !e.hasError).length ?? 0) > 2) {- _focusNewCode(code);- }- }- }- } catch (e, s) {- await showGenericErrorDialog(context: context, error: e);- _logger.severe("Error while importing from gallery", e, s);- }- }-Widget _getFab() {if (PlatformUtil.isDesktop()) {return FloatingActionButton(@@ -752,15 +725,6 @@ class _HomePageState extends State<HomePage> {labelWidget: SpeedDialLabelWidget(context.l10n.scanAQrCode),onTap: _redirectToScannerPage,),- if (PlatformUtil.isMobile() &&- FeatureFlagService.instance.isInternalUserOrDebugBuild())- SpeedDialChild(- child: const Icon(Icons.image),- foregroundColor: Theme.of(context).colorScheme.fabForegroundColor,- backgroundColor: Theme.of(context).colorScheme.fabBackgroundColor,- labelWidget: const SpeedDialLabelWidget("Import from gallery"),- onTap: _importFromGallery,- ),SpeedDialChild(child: const Icon(Icons.keyboard),foregroundColor: Theme.of(context).colorScheme.fabForegroundColor,diff --git a/auth/pubspec.lock b/auth/pubspec.lockindex e85a4e6bf2..cdaaff83e0 100644--- a/auth/pubspec.lock+++ b/auth/pubspec.lock@@ -1317,14 +1317,6 @@ packages:url: "https://pub.dev"source: hostedversion: "0.4.15"- scan:- dependency: "direct main"- description:- name: scan- sha256: b343ec36f863a88d41eb4c174b810c055c6bd1f1822b2188ab31aab684fb7cdb- url: "https://pub.dev"- source: hosted- version: "1.6.0"screen_retriever:dependency: transitivedescription:diff --git a/auth/pubspec.yaml b/auth/pubspec.yamlindex 31362a001b..959ab72da0 100644--- a/auth/pubspec.yaml+++ b/auth/pubspec.yaml@@ -84,7 +84,6 @@ dependencies:qr_code_scanner: ^1.0.1qr_flutter: ^4.1.0rive: ^0.13.20- scan: ^1.6.0sentry: ^8.7.0sentry_flutter: ^8.7.0share_plus: ^10.0.2