π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[locker] Give the document scanner its own button above the add FAB
laurenspriem504a3d595fed
diff --git a/mobile/apps/locker/lib/ui/components/save_to_locker_empty_state_widget.dart b/mobile/apps/locker/lib/ui/components/save_to_locker_empty_state_widget.dartindex 9ef5f728b3..90fab302b2 100644--- a/mobile/apps/locker/lib/ui/components/save_to_locker_empty_state_widget.dart+++ b/mobile/apps/locker/lib/ui/components/save_to_locker_empty_state_widget.dart@@ -29,7 +29,7 @@ class SaveToLockerEmptyStateWidget extends StatelessWidget {crossAxisAlignment: CrossAxisAlignment.stretch,children: [const SaveToLockerBanner(),- for (final option in saveOptions(context)) ...[+ for (final option in saveOptions(context, includeScanner: true)) ...[const SizedBox(height: _optionSpacing),_SaveOptionTile(title: option.title,diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dartindex 2acc79291d..f5959ea817 100644--- a/mobile/apps/locker/lib/ui/pages/home_page.dart+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart@@ -20,6 +20,7 @@ import 'package:locker/models/selected_files.dart';import 'package:locker/services/collections/collections_service.dart';import 'package:locker/services/collections/models/collection.dart';import 'package:locker/services/configuration.dart';+import 'package:locker/services/feature_flag_service.dart';import 'package:locker/services/files/sync/models/file.dart';import 'package:locker/services/local_settings.dart';import "package:locker/states/user_details_state.dart";@@ -654,16 +655,28 @@ class _HomePageState extends UploaderPageState<HomePage>if (_selectedFiles.files.isNotEmpty) {return const SizedBox.shrink();}- return FloatingActionButton(- tooltip: 'Add item',- onPressed: _openSavePage,- shape: const CircleBorder(),- backgroundColor: colors.primary,- elevation: 0,- child: HugeIcon(- icon: HugeIcons.strokeRoundedPlusSign,- color: colors.specialWhite,- ),+ return Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.end,+ children: [+ if (FeatureFlagService+ .instance+ .documentScanner) ...[+ _buildScannerFab(colors),+ const SizedBox(height: 14),+ ],+ FloatingActionButton(+ tooltip: 'Add item',+ onPressed: _openSavePage,+ shape: const CircleBorder(),+ backgroundColor: colors.primary,+ elevation: 0,+ child: HugeIcon(+ icon: HugeIcons.strokeRoundedPlusSign,+ color: colors.specialWhite,+ ),+ ),+ ],);},),@@ -840,4 +853,34 @@ class _HomePageState extends UploaderPageState<HomePage>onUploadFiles: uploadFiles,);}++ Widget _buildScannerFab(ColorTokens colors) {+ return SizedBox(+ width: 56,+ child: Center(+ child: Semantics(+ button: true,+ label: context.strings.scanDocumentTitle,+ child: FABComponent(+ variant: FABComponentVariant.secondary,+ icon: HugeIcon(+ icon: HugeIcons.strokeRoundedCamera01,+ color: colors.primary,+ size: 24,+ ),+ onTap: _openScanner,+ ),+ ),+ ),+ );+ }++ void _openScanner() {+ handleSaveOption(+ context,+ SaveOptionType.scanDocument,+ onUploadDocument: addFile,+ onUploadFiles: uploadFiles,+ );+ }}diff --git a/mobile/apps/locker/lib/ui/pages/save_page.dart b/mobile/apps/locker/lib/ui/pages/save_page.dartindex afab61de5c..d650da500e 100644--- a/mobile/apps/locker/lib/ui/pages/save_page.dart+++ b/mobile/apps/locker/lib/ui/pages/save_page.dart@@ -28,10 +28,13 @@ class SaveOption {final String description;}-List<SaveOption> saveOptions(BuildContext context) {+List<SaveOption> saveOptions(+ BuildContext context, {+ bool includeScanner = false,+}) {final l10n = context.strings;return [- if (FeatureFlagService.instance.documentScanner)+ if (includeScanner && FeatureFlagService.instance.documentScanner)SaveOption(type: SaveOptionType.scanDocument,icon: HugeIcons.strokeRoundedFileScan,