π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Extract QR code dialog to shared ente_qr_ui package for auth and photos
Prateek Sunal7dac2aa090d7
diff --git a/mobile/apps/auth/lib/ui/code_widget.dart b/mobile/apps/auth/lib/ui/code_widget.dartindex 3b9d26e6fe..eddeac9f32 100644--- a/mobile/apps/auth/lib/ui/code_widget.dart+++ b/mobile/apps/auth/lib/ui/code_widget.dart@@ -13,10 +13,10 @@ import 'package:ente_auth/services/local_backup_service.dart';import 'package:ente_auth/services/preference_service.dart';import 'package:ente_auth/store/code_display_store.dart';import 'package:ente_auth/store/code_store.dart';+import 'package:ente_auth/theme/colors.dart';import 'package:ente_auth/theme/ente_theme.dart';import 'package:ente_auth/ui/code_timer_progress.dart';import 'package:ente_auth/ui/components/note_dialog.dart';-import 'package:ente_auth/ui/qr_code_dialog.dart';import 'package:ente_auth/ui/share/code_share.dart';import 'package:ente_auth/ui/utils/icon_utils.dart';import 'package:ente_auth/utils/dialog_util.dart';@@ -25,6 +25,7 @@ import 'package:ente_auth/utils/toast_util.dart';import 'package:ente_auth/utils/totp_util.dart';import 'package:ente_events/event_bus.dart';import 'package:ente_lock_screen/local_authentication_service.dart';+import 'package:ente_qr_ui/ente_qr_ui.dart';import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';import 'package:flutter_context_menu/flutter_context_menu.dart';@@ -894,10 +895,30 @@ class _CodeWidgetState extends State<CodeWidget> {if (!isAuthSuccessful) {return;}+ final qrData = widget.code.rawData+ .replaceAll('algorithm=Algorithm.', 'algorithm=')+ .replaceAll('algorithm=sha1', 'algorithm=SHA1')+ .replaceAll('algorithm=sha256', 'algorithm=SHA256')+ .replaceAll('algorithm=sha512', 'algorithm=SHA512');+await showDialog(context: context,- builder: (BuildContext context) {- return QrCodeDialog(code: widget.code);+ builder: (BuildContext dialogContext) {+ return QrCodeDialog(+ data: qrData,+ title: widget.code.account,+ subtitle: widget.code.issuer,+ accentColor: accentColor,+ shareFileName: 'ente_auth_qr_${widget.code.account}.png',+ shareText: 'QR code for ${widget.code.account}',+ dialogTitle: context.l10n.qrCode,+ shareButtonText: context.l10n.share,+ logoAssetPath: 'assets/qr_logo.png',+ branding: const QrSvgBranding(+ assetPath: 'assets/svg/auth-logo.svg',+ height: 12,+ ),+ );},);}diff --git a/mobile/apps/auth/lib/ui/home_page.dart b/mobile/apps/auth/lib/ui/home_page.dartindex 17142c42bf..410a272410 100644--- a/mobile/apps/auth/lib/ui/home_page.dart+++ b/mobile/apps/auth/lib/ui/home_page.dart@@ -19,6 +19,7 @@ import 'package:ente_auth/services/local_backup_service.dart';import 'package:ente_auth/services/preference_service.dart';import 'package:ente_auth/store/code_display_store.dart';import 'package:ente_auth/store/code_store.dart';+import 'package:ente_auth/theme/colors.dart';import 'package:ente_auth/theme/ente_theme.dart';import 'package:ente_auth/theme/text_style.dart';import 'package:ente_auth/ui/account/logout_dialog.dart';@@ -33,7 +34,6 @@ import 'package:ente_auth/ui/home/add_tag_sheet.dart';import 'package:ente_auth/ui/home/coach_mark_widget.dart';import 'package:ente_auth/ui/home/home_empty_state.dart';import 'package:ente_auth/ui/home/speed_dial_label_widget.dart';-import 'package:ente_auth/ui/qr_code_dialog.dart';import 'package:ente_auth/ui/reorder_codes_page.dart';import 'package:ente_auth/ui/scanner_page.dart';import 'package:ente_auth/ui/settings_page.dart';@@ -49,6 +49,7 @@ import 'package:ente_events/event_bus.dart';import 'package:ente_lock_screen/local_authentication_service.dart';import 'package:ente_lock_screen/lock_screen_settings.dart';import 'package:ente_lock_screen/ui/app_lock.dart';+import 'package:ente_qr_ui/ente_qr_ui.dart';import 'package:ente_ui/pages/base_home_page.dart';import 'package:flutter/foundation.dart';import 'package:flutter/material.dart';@@ -446,10 +447,30 @@ class _HomePageState extends State<HomePage> {if (!isAuthSuccessful) return;_codeDisplayStore.clearSelection();+ final qrData = code.rawData+ .replaceAll('algorithm=Algorithm.', 'algorithm=')+ .replaceAll('algorithm=sha1', 'algorithm=SHA1')+ .replaceAll('algorithm=sha256', 'algorithm=SHA256')+ .replaceAll('algorithm=sha512', 'algorithm=SHA512');+await showDialog(context: context,- builder: (BuildContext context) {- return QrCodeDialog(code: code);+ builder: (BuildContext dialogContext) {+ return QrCodeDialog(+ data: qrData,+ title: code.account,+ subtitle: code.issuer,+ accentColor: accentColor,+ shareFileName: 'ente_auth_qr_${code.account}.png',+ shareText: 'QR code for ${code.account}',+ dialogTitle: context.l10n.qrCode,+ shareButtonText: context.l10n.share,+ logoAssetPath: 'assets/qr_logo.png',+ branding: const QrSvgBranding(+ assetPath: 'assets/svg/auth-logo.svg',+ height: 12,+ ),+ );},);}diff --git a/mobile/apps/auth/lib/ui/qr_code_dialog.dart b/mobile/apps/auth/lib/ui/qr_code_dialog.dartdeleted file mode 100644index f736b24c73..0000000000--- a/mobile/apps/auth/lib/ui/qr_code_dialog.dart+++ /dev/null@@ -1,286 +0,0 @@-import 'dart:io';-import 'dart:math';-import 'dart:typed_data';-import 'dart:ui' as ui;--import "package:ente_auth/l10n/l10n.dart";-import 'package:ente_auth/models/code.dart';-import 'package:ente_auth/theme/colors.dart';-import 'package:ente_auth/theme/ente_theme.dart';-import "package:flutter/material.dart";-import 'package:flutter/rendering.dart';-import 'package:flutter_svg/flutter_svg.dart';-import 'package:path_provider/path_provider.dart';-import 'package:pretty_qr_code/pretty_qr_code.dart';-import 'package:share_plus/share_plus.dart';--class QrCodeDialog extends StatefulWidget {- final Code code;-- const QrCodeDialog({- super.key,- required this.code,- });-- @override- State<QrCodeDialog> createState() => _QrCodeDialogState();-}--class _QrCodeDialogState extends State<QrCodeDialog> {- final GlobalKey _qrKey = GlobalKey();-- Future<void> _shareQrCode() async {- try {- final RenderRepaintBoundary boundary =- _qrKey.currentContext!.findRenderObject() as RenderRepaintBoundary;- final ui.Image image = await boundary.toImage(pixelRatio: 3.0);- final ByteData? byteData =- await image.toByteData(format: ui.ImageByteFormat.png);- if (byteData != null) {- final Uint8List pngBytes = byteData.buffer.asUint8List();-- final directory = await getTemporaryDirectory();- final file = File(- '${directory.path}/ente_auth_qr_${widget.code.account}.png',- );- await file.writeAsBytes(pngBytes);-- // Get the render box for share position (required for iPad)- final box = context.findRenderObject() as RenderBox?;- final sharePositionOrigin =- box != null ? box.localToGlobal(Offset.zero) & box.size : null;-- await SharePlus.instance.share(- ShareParams(- files: [XFile(file.path)],- text: 'QR code for ${widget.code.account}',- sharePositionOrigin: sharePositionOrigin,- ),- );-- // Close the dialog after sharing is initiated- if (mounted) {- Navigator.of(context).pop();- }- }- } catch (e) {- debugPrint('Error sharing QR code: $e');- }- }-- @override- Widget build(BuildContext context) {- final screenWidth = MediaQuery.of(context).size.width;- final double qrSize = min(screenWidth - 80, 300.0);- final double qrCodeSize =- max(qrSize - 100, 150.0); // Ensure minimum size of 150- final enteTextTheme = getEnteTextTheme(context);- final enteColorScheme = getEnteColorScheme(context);- final l10n = context.l10n;-- final String qrData = widget.code.rawData- .replaceAll('algorithm=Algorithm.', 'algorithm=')- .replaceAll('algorithm=sha1', 'algorithm=SHA1')- .replaceAll('algorithm=sha256', 'algorithm=SHA256')- .replaceAll('algorithm=sha512', 'algorithm=SHA512');-- final String accountName = widget.code.account;- final String issuerName = widget.code.issuer;-- // QR text color - always black for scanability- const qrTextColor = textBaseLight;-- final bool isDarkMode = Theme.of(context).brightness == Brightness.dark;-- return Dialog(- shape: RoundedRectangleBorder(- borderRadius: BorderRadius.circular(24),- ),- child: Container(- padding: const EdgeInsets.fromLTRB(20, 18, 20, 20),- decoration: BoxDecoration(- color: enteColorScheme.backgroundBase,- borderRadius: BorderRadius.circular(24),- ),- child: Column(- mainAxisSize: MainAxisSize.min,- children: [- // Header with close button- Padding(- padding: const EdgeInsets.only(left: 6, bottom: 4),- child: Row(- mainAxisAlignment: MainAxisAlignment.spaceBetween,- children: [- Text(- l10n.qrCode,- style: enteTextTheme.largeBold.copyWith(- fontSize: 20,- fontWeight: FontWeight.w700,- ),- ),- GestureDetector(- onTap: () => Navigator.of(context).pop(),- child: Container(- width: 36,- height: 36,- decoration: BoxDecoration(- color: isDarkMode- ? enteColorScheme.backgroundElevated2- : qrBoxColor,- borderRadius: BorderRadius.circular(18),- ),- child: Icon(- Icons.close,- color:- isDarkMode ? enteColorScheme.textBase : qrTextColor,- size: 20,- ),- ),- ),- ],- ),- ),- const SizedBox(height: 8),-- // QR Code with RepaintBoundary for sharing- RepaintBoundary(- key: _qrKey,- child: Container(- width: double.infinity,- padding: const EdgeInsets.fromLTRB(20, 20, 20, 12),- decoration: BoxDecoration(- color: qrBoxColor,- borderRadius: BorderRadius.circular(22),- ),- child: Stack(- alignment: Alignment.center,- children: [- Column(- mainAxisSize: MainAxisSize.min,- crossAxisAlignment: CrossAxisAlignment.center,- children: [- // Account name at top center (inside border)- SizedBox(- width: 225,- child: Text(- accountName,- textAlign: TextAlign.center,- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: enteTextTheme.largeBold.copyWith(- color: qrTextColor,- letterSpacing: -0.76,- ),- ),- ),- if (issuerName.isNotEmpty) ...[- SizedBox(- width: 175,- child: Text(- issuerName,- textAlign: TextAlign.center,- maxLines: 1,- overflow: TextOverflow.ellipsis,- style: enteTextTheme.miniBold.copyWith(- color: qrTextColor.withValues(alpha: 0.6),- letterSpacing: -0.48,- ),- ),- ),- ],- const SizedBox(height: 20),-- // QR Code with pretty styling- SizedBox(- width: qrCodeSize,- height: qrCodeSize,- child: PrettyQrView(- qrImage: QrImage(- QrCode.fromData(- data: qrData,- errorCorrectLevel: QrErrorCorrectLevel.L,- ),- ),- decoration: const PrettyQrDecoration(- shape: PrettyQrShape.custom(- PrettyQrDotsSymbol(- color: qrTextColor,- unifiedFinderPattern: false,- unifiedAlignmentPatterns: false,- ),- finderPattern: PrettyQrSquaresSymbol(- color: qrTextColor,- rounding: 0.5,- unifiedFinderPattern: true,- finderPatternOuterThickness: 1.4,- finderPatternOuterColor: accentColor,- finderPatternInnerDotSize: 0.8,- finderPatternInnerRounding: 1.0,- ),- alignmentPatterns: PrettyQrSquaresSymbol(- color: qrTextColor,- rounding: 1.0,- ),- ),- image: PrettyQrDecorationImage(- image: AssetImage('assets/qr_logo.png'),- scale: 0.25,- padding: EdgeInsets.all(24),- position:- PrettyQrDecorationImagePosition.embedded,- ),- background: Colors.transparent,- quietZone: PrettyQrQuietZone.zero,- ),- ),- ),- const SizedBox(height: 42),- ],- ),-- // Auth branding at bottom right (inside border)- Positioned(- bottom: 0,- right: 2,- child: SvgPicture.asset(- 'assets/svg/auth-logo.svg',- height: 12,- colorFilter: const ColorFilter.mode(- accentColor,- BlendMode.srcIn,- ),- ),- ),- ],- ),- ),- ),- const SizedBox(height: 24),-- // Share button- GestureDetector(- onTap: _shareQrCode,- child: Container(- width: double.infinity,- padding:- const EdgeInsets.symmetric(horizontal: 16, vertical: 14),- decoration: BoxDecoration(- color: accentColor,- borderRadius: BorderRadius.circular(12),- ),- child: Text(- l10n.share,- textAlign: TextAlign.center,- style: enteTextTheme.bodyBold.copyWith(- color: Colors.white,- height: 1.25,- ),- ),- ),- ),- ],- ),- ),- );- }-}diff --git a/mobile/apps/auth/pubspec.lock b/mobile/apps/auth/pubspec.lockindex eca0279ead..9be5cde48f 100644--- a/mobile/apps/auth/pubspec.lock+++ b/mobile/apps/auth/pubspec.lock@@ -465,6 +465,13 @@ packages:relative: truesource: pathversion: "0.0.1"+ ente_qr_ui:+ dependency: "direct main"+ description:+ path: "../../packages/qr"+ relative: true+ source: path+ version: "0.0.1"ente_strings:dependency: "direct main"description:diff --git a/mobile/apps/auth/pubspec.yaml b/mobile/apps/auth/pubspec.yamlindex 83b4e75668..66a216d7bf 100644--- a/mobile/apps/auth/pubspec.yaml+++ b/mobile/apps/auth/pubspec.yaml@@ -45,6 +45,8 @@ dependencies:path: ../../packages/networkente_qr:path: plugins/qr+ ente_qr_ui:+ path: ../../packages/qrente_strings:path: ../../packages/stringsente_ui:diff --git a/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dart b/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dartindex 056622c647..a309706713 100644--- a/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dart+++ b/mobile/apps/photos/lib/ui/sharing/manage_links_widget.dart@@ -2,6 +2,7 @@ import 'dart:convert';import 'package:collection/collection.dart';import 'package:ente_crypto/ente_crypto.dart';+import 'package:ente_qr_ui/ente_qr_ui.dart';import 'package:flutter/material.dart';import "package:flutter/services.dart";import "package:photos/generated/l10n.dart";@@ -20,7 +21,6 @@ import 'package:photos/ui/notification/toast.dart';import 'package:photos/ui/sharing/pickers/device_limit_picker_page.dart';import 'package:photos/ui/sharing/pickers/layout_picker_page.dart';import 'package:photos/ui/sharing/pickers/link_expiry_picker_page.dart';-import 'package:photos/ui/sharing/qr_code_dialog_widget.dart';import 'package:photos/utils/dialog_util.dart';import 'package:photos/utils/navigation_util.dart';import "package:photos/utils/share_util.dart";@@ -392,9 +392,26 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {onTap: () async {await showDialog<void>(context: context,- builder: (BuildContext context) {- return QrCodeDialogWidget(- collection: widget.collection!,+ builder: (BuildContext dialogContext) {+ return QrCodeDialog(+ data: urlValue,+ title: widget.collection!.displayName,+ accentColor: enteColorScheme.primary500,+ shareFileName:+ 'ente_qr_${widget.collection!.displayName}.png',+ shareText:+ 'Scan this QR code to view my ${widget.collection!.displayName} album on ente',+ dialogTitle: AppLocalizations.of(context).qrCode,+ shareButtonText:+ AppLocalizations.of(context).share,+ logoAssetPath: 'assets/qr_logo.png',+ branding: const QrTextBranding(+ text: 'ente',+ style: TextStyle(+ fontSize: 16,+ fontWeight: FontWeight.w800,+ ),+ ),);},);diff --git a/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dart b/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dartindex a48b23468f..02460bee7a 100644--- a/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dart+++ b/mobile/apps/photos/lib/ui/sharing/public_link_enabled_actions_widget.dart@@ -1,4 +1,5 @@import 'package:collection/collection.dart';+import 'package:ente_qr_ui/ente_qr_ui.dart';import 'package:flutter/material.dart';import 'package:flutter/services.dart';import 'package:photos/generated/l10n.dart';@@ -9,7 +10,6 @@ import 'package:photos/ui/components/captioned_text_widget.dart';import 'package:photos/ui/components/divider_widget.dart';import 'package:photos/ui/components/menu_item_widget/menu_item_widget.dart';import 'package:photos/ui/notification/toast.dart';-import 'package:photos/ui/sharing/qr_code_dialog_widget.dart';import 'package:photos/utils/share_util.dart';class PublicLinkEnabledActionsWidget extends StatelessWidget {@@ -103,11 +103,27 @@ class PublicLinkEnabledActionsWidget extends StatelessWidget {leadingIcon: Icons.qr_code_outlined,menuItemColor: enteColorScheme.fillFaint,onTap: () async {+ final enteColorScheme = getEnteColorScheme(context);await showDialog<void>(context: context,builder: (BuildContext dialogContext) {- return QrCodeDialogWidget(- collection: collection,+ return QrCodeDialog(+ data: url,+ title: collection.displayName,+ accentColor: enteColorScheme.primary500,+ shareFileName: 'ente_qr_${collection.displayName}.png',+ shareText:+ 'Scan this QR code to view my ${collection.displayName} album on ente',+ dialogTitle: AppLocalizations.of(context).qrCode,+ shareButtonText: AppLocalizations.of(context).share,+ logoAssetPath: 'assets/qr_logo.png',+ branding: const QrTextBranding(+ text: 'ente',+ style: TextStyle(+ fontSize: 16,+ fontWeight: FontWeight.w800,+ ),+ ),);},);diff --git a/mobile/apps/photos/lib/ui/sharing/qr_code_dialog_widget.dart b/mobile/apps/photos/lib/ui/sharing/qr_code_dialog_widget.dartdeleted file mode 100644index d4605959c6..0000000000--- a/mobile/apps/photos/lib/ui/sharing/qr_code_dialog_widget.dart+++ /dev/null@@ -1,260 +0,0 @@-import 'dart:io';-import 'dart:math';-import 'dart:typed_data';-import 'dart:ui' as ui;--import 'package:flutter/material.dart';-import 'package:flutter/rendering.dart';-import 'package:path_provider/path_provider.dart';-import 'package:photos/l10n/l10n.dart';-import 'package:photos/models/collection/collection.dart';-import 'package:photos/services/collections_service.dart';-import 'package:photos/theme/colors.dart';-import 'package:photos/theme/ente_theme.dart';-import 'package:pretty_qr_code/pretty_qr_code.dart';-import 'package:share_plus/share_plus.dart';--class QrCodeDialogWidget extends StatefulWidget {- final Collection collection;-- const QrCodeDialogWidget({- super.key,- required this.collection,- });-- @override- State<QrCodeDialogWidget> createState() => _QrCodeDialogWidgetState();-}--class _QrCodeDialogWidgetState extends State<QrCodeDialogWidget> {- final GlobalKey _qrKey = GlobalKey();-- Future<void> _shareQrCode() async {- try {- final RenderRepaintBoundary boundary =- _qrKey.currentContext!.findRenderObject() as RenderRepaintBoundary;- final ui.Image image = await boundary.toImage(pixelRatio: 3.0);- final ByteData? byteData =- await image.toByteData(format: ui.ImageByteFormat.png);- if (byteData != null) {- final Uint8List pngBytes = byteData.buffer.asUint8List();-- final directory = await getTemporaryDirectory();- final file = File(- '${directory.path}/ente_qr_${widget.collection.displayName}.png',- );- await file.writeAsBytes(pngBytes);-- await SharePlus.instance.share(- ShareParams(- files: [XFile(file.path)],- text:- 'Scan this QR code to view my ${widget.collection.displayName} album on ente',- ),- );-- // Close the dialog after sharing is initiated- if (mounted) {- Navigator.of(context).pop();- }- }- } catch (e) {- debugPrint('Error sharing QR code: $e');- }- }-- @override- Widget build(BuildContext context) {- final screenWidth = MediaQuery.of(context).size.width;- final double qrSize = min(screenWidth - 80, 300.0);- final enteTextTheme = getEnteTextTheme(context);- final enteColorScheme = getEnteColorScheme(context);-- // Get the public URL for the collection- final String publicUrl =- CollectionsService.instance.getPublicUrl(widget.collection);-- // Get album name, truncate if too long- final String albumName = widget.collection.displayName.length > 30- ? '${widget.collection.displayName.substring(0, 27)}...'- : widget.collection.displayName;-- // QR text color - always black for scanability- const qrTextColor = textBaseLight;-- final bool isDarkMode = Theme.of(context).brightness == Brightness.dark;-- return Dialog(- shape: RoundedRectangleBorder(- borderRadius: BorderRadius.circular(24),- ),- child: Container(- padding: const EdgeInsets.fromLTRB(20, 18, 20, 20),- decoration: BoxDecoration(- color: enteColorScheme.backgroundBase,- borderRadius: BorderRadius.circular(24),- ),- child: Column(- mainAxisSize: MainAxisSize.min,- children: [- // Header with close button- Padding(- padding: const EdgeInsets.only(left: 6, bottom: 4),- child: Row(- mainAxisAlignment: MainAxisAlignment.spaceBetween,- children: [- Text(- context.l10n.qrCode,- style: enteTextTheme.largeBold.copyWith(- fontSize: 20,- fontWeight: FontWeight.w700,- ),- ),- GestureDetector(- onTap: () => Navigator.of(context).pop(),- child: Container(- width: 36,- height: 36,- decoration: BoxDecoration(- color: isDarkMode- ? enteColorScheme.backgroundElevated2- : qrBoxColor,- borderRadius: BorderRadius.circular(18),- ),- child: Icon(- Icons.close,- color: isDarkMode- ? enteColorScheme.textBase- : qrTextColor,- size: 20,- ),- ),- ),- ],- ),- ),- const SizedBox(height: 8),-- // QR Code with RepaintBoundary for sharing- RepaintBoundary(- key: _qrKey,- child: Container(- width: double.infinity,- padding: const EdgeInsets.fromLTRB(20, 20, 20, 12),- decoration: BoxDecoration(- color: qrBoxColor,- borderRadius: BorderRadius.circular(22),- ),- child: Stack(- alignment: Alignment.center,- children: [- Column(- mainAxisSize: MainAxisSize.min,- crossAxisAlignment: CrossAxisAlignment.center,- children: [- // Album name at top center (inside border)- Text(- albumName,- style: enteTextTheme.largeBold.copyWith(- color: qrTextColor,- fontSize: 20,- ),- textAlign: TextAlign.center,- ),- const SizedBox(height: 20),-- // QR Code with pretty styling- SizedBox(- width: qrSize - 100,- height: qrSize - 100,- child: PrettyQrView(- qrImage: QrImage(- QrCode.fromData(- data: publicUrl,- errorCorrectLevel: QrErrorCorrectLevel.M,- ),- ),- decoration: PrettyQrDecoration(- shape: PrettyQrShape.custom(- const PrettyQrDotsSymbol(- color: qrTextColor,- unifiedFinderPattern: false,- unifiedAlignmentPatterns: false,- ),- finderPattern: PrettyQrSquaresSymbol(- color: qrTextColor,- rounding: 0.5,- unifiedFinderPattern: true,- finderPatternOuterThickness: 1.4,- finderPatternOuterColor:- enteColorScheme.primary500,- finderPatternInnerDotSize: 0.8,- finderPatternInnerRounding: 1.0,- ),- alignmentPatterns: const PrettyQrSquaresSymbol(- color: qrTextColor,- rounding: 1.0,- ),- ),- image: const PrettyQrDecorationImage(- image: AssetImage('assets/qr_logo.png'),- scale: 0.25,- padding: EdgeInsets.all(24),- position:- PrettyQrDecorationImagePosition.embedded,- ),- background: Colors.transparent,- quietZone: PrettyQrQuietZone.zero,- ),- ),- ),- const SizedBox(height: 42),- ],- ),-- // Ente branding at bottom right (inside border)- Positioned(- bottom: 0,- right: 2,- child: Text(- 'ente',- style: enteTextTheme.brandSmall.copyWith(- color: enteColorScheme.primary500,- fontSize: 16,- fontWeight: FontWeight.w800,- ),- ),- ),- ],- ),- ),- ),- const SizedBox(height: 24),-- // Save button- GestureDetector(- onTap: _shareQrCode,- child: Container(- width: double.infinity,- padding:- const EdgeInsets.symmetric(horizontal: 16, vertical: 14),- decoration: BoxDecoration(- color: enteColorScheme.primary500,- borderRadius: BorderRadius.circular(12),- ),- child: Text(- context.l10n.share,- textAlign: TextAlign.center,- style: enteTextTheme.bodyBold.copyWith(- color: Colors.white,- height: 1.25,- ),- ),- ),- ),- ],- ),- ),- );- }-}diff --git a/mobile/apps/photos/lib/utils/email_util.dart b/mobile/apps/photos/lib/utils/email_util.dartindex e4a3512d3d..b9ca96e82d 100644--- a/mobile/apps/photos/lib/utils/email_util.dart+++ b/mobile/apps/photos/lib/utils/email_util.dart@@ -217,7 +217,7 @@ Future<void> exportLogs(BuildContext context, String zipFilePath) async {name: logFileName,filePath: zipFilePath,mimeType: MimeType.zip,- ext: 'zip',+ fileExtension: 'zip',);} else {await SharePlus.instance.share(diff --git a/mobile/apps/photos/pubspec.lock b/mobile/apps/photos/pubspec.lockindex 88c2dd1c04..231eb76f33 100644--- a/mobile/apps/photos/pubspec.lock+++ b/mobile/apps/photos/pubspec.lock@@ -616,6 +616,13 @@ packages:relative: truesource: pathversion: "0.0.1"+ ente_qr_ui:+ dependency: "direct main"+ description:+ path: "../../packages/qr"+ relative: true+ source: path+ version: "0.0.1"equatable:dependency: "direct main"description:@@ -743,10 +750,10 @@ packages:dependency: "direct main"description:name: file_saver- sha256: "017a127de686af2d2fbbd64afea97052d95f2a0f87d19d25b87e097407bf9c1e"+ sha256: "9d93db09bd4da9e43238f9dd485360fc51a5c138eea5ef5f407ec56e58079ac0"url: "https://pub.dev"source: hosted- version: "0.2.14"+ version: "0.3.1"firebase_core:dependency: "direct main"description:diff --git a/mobile/apps/photos/pubspec.yaml b/mobile/apps/photos/pubspec.yamlindex 58cfae492b..1e968f2514 100644--- a/mobile/apps/photos/pubspec.yaml+++ b/mobile/apps/photos/pubspec.yaml@@ -58,6 +58,8 @@ dependencies:path: plugins/ente_cryptoente_feature_flag:path: plugins/ente_feature_flag+ ente_qr_ui:+ path: ../../packages/qrequatable: ^2.0.5event_bus: ^2.0.0exif_reader:@@ -75,7 +77,7 @@ dependencies:path: flutter/flutterref: remove-event-subfigma_squircle: ^0.6.3- file_saver: ^0.2.14+ file_saver: ^0.3.1firebase_core: ^3.6.0firebase_messaging: ^15.1.3fixnum: ^1.1.1@@ -109,7 +111,7 @@ dependencies:flutter_timezone: ^4.1.0fluttertoast: ^8.0.6fraction: ^5.0.2- freezed_annotation: ^3.0.0+ freezed_annotation: ">=2.4.1 <4.0.0"home_widget: ^0.8.0html_unescape: ^2.0.0http: ^1.1.0diff --git a/mobile/packages/qr/lib/ente_qr_ui.dart b/mobile/packages/qr/lib/ente_qr_ui.dartnew file mode 100644index 0000000000..ce044fa3ee--- /dev/null+++ b/mobile/packages/qr/lib/ente_qr_ui.dart@@ -0,0 +1,4 @@+library ente_qr_ui;++export 'package:pretty_qr_code/pretty_qr_code.dart' show QrErrorCorrectLevel;+export 'qr_code_dialog.dart';diff --git a/mobile/packages/qr/lib/qr_code_dialog.dart b/mobile/packages/qr/lib/qr_code_dialog.dartnew file mode 100644index 0000000000..845f6a32e2--- /dev/null+++ b/mobile/packages/qr/lib/qr_code_dialog.dart@@ -0,0 +1,391 @@+import 'dart:io';+import 'dart:math';+import 'dart:typed_data';+import 'dart:ui' as ui;++import 'package:flutter/material.dart';+import 'package:flutter/rendering.dart';+import 'package:flutter_svg/flutter_svg.dart';+import 'package:path_provider/path_provider.dart';+import 'package:pretty_qr_code/pretty_qr_code.dart';+import 'package:share_plus/share_plus.dart';++const Color _kDefaultQrBoxColor = Color(0xFFF5F5F7);+const Color _kDefaultQrTextColor = Color(0xFF1C1C1C);+const TextStyle _kDefaultDialogTitleStyle = TextStyle(+ fontSize: 20,+ fontWeight: FontWeight.w700,+);+const TextStyle _kDefaultTitleStyle = TextStyle(+ fontSize: 19.11,+ fontWeight: FontWeight.w600,+ letterSpacing: -0.76,+ height: 1.2,+ leadingDistribution: TextLeadingDistribution.even,+ color: _kDefaultQrTextColor,+);+const TextStyle _kDefaultSubtitleStyle = TextStyle(+ fontSize: 12,+ fontWeight: FontWeight.w600,+ letterSpacing: -0.48,+ height: 1.2,+ leadingDistribution: TextLeadingDistribution.even,+ color: Color(0x991C1C1C),+);+const TextStyle _kDefaultShareButtonStyle = TextStyle(+ fontSize: 16,+ fontWeight: FontWeight.w600,+ color: Colors.white,+);++sealed class QrBranding {+ const QrBranding();+}++class QrTextBranding extends QrBranding {+ final String text;+ final TextStyle style;++ const QrTextBranding({+ required this.text,+ this.style = const TextStyle(+ fontSize: 16,+ fontWeight: FontWeight.w800,+ ),+ });+}++class QrSvgBranding extends QrBranding {+ final String assetPath;+ final double height;++ const QrSvgBranding({+ required this.assetPath,+ this.height = 12,+ });+}++class QrCodeDialog extends StatefulWidget {+ final String data;+ final String title;+ final String? subtitle;+ final Color accentColor;+ final QrBranding? branding;+ final String shareFileName;+ final String shareText;+ final int errorCorrectionLevel;+ final String dialogTitle;+ final String shareButtonText;+ final String? logoAssetPath;+ final PrettyQrDecoration? decoration;+ final Color? backgroundColor;+ final Color? qrCardColor;+ final Color? closeButtonBackgroundColor;+ final Color? closeButtonIconColor;+ final Color? shareButtonBackgroundColor;+ final EdgeInsets qrCardPadding;+ final double backgroundBorderRadius;+ final double cardBorderRadius;+ final double horizontalPadding;+ final double maxQrSize;+ final double minQrSize;+ final double titleMaxWidth;+ final double subtitleMaxWidth;+ final TextStyle? dialogTitleTextStyle;+ final TextStyle? titleTextStyle;+ final TextStyle? subtitleTextStyle;+ final TextStyle? shareButtonTextStyle;++ const QrCodeDialog({+ super.key,+ required this.data,+ required this.title,+ required this.accentColor,+ required this.shareFileName,+ required this.shareText,+ this.subtitle,+ this.branding,+ this.errorCorrectionLevel = QrErrorCorrectLevel.M,+ this.dialogTitle = 'QR Code',+ this.shareButtonText = 'Share',+ this.logoAssetPath,+ this.decoration,+ this.backgroundColor,+ this.qrCardColor,+ this.closeButtonBackgroundColor,+ this.closeButtonIconColor,+ this.shareButtonBackgroundColor,+ this.qrCardPadding = const EdgeInsets.fromLTRB(20, 20, 20, 12),+ this.backgroundBorderRadius = 24,+ this.cardBorderRadius = 22,+ this.horizontalPadding = 80,+ this.maxQrSize = 300,+ this.minQrSize = 150,+ this.titleMaxWidth = 225,+ this.subtitleMaxWidth = 175,+ this.dialogTitleTextStyle,+ this.titleTextStyle,+ this.subtitleTextStyle,+ this.shareButtonTextStyle,+ });++ @override+ State<QrCodeDialog> createState() => _QrCodeDialogState();+}++class _QrCodeDialogState extends State<QrCodeDialog> {+ final GlobalKey _qrKey = GlobalKey();++ Future<void> _shareQrCode() async {+ try {+ final boundary =+ _qrKey.currentContext?.findRenderObject() as RenderRepaintBoundary?;+ if (boundary == null) return;++ final ui.Image image = await boundary.toImage(pixelRatio: 3.0);+ final ByteData? byteData =+ await image.toByteData(format: ui.ImageByteFormat.png);+ if (byteData == null) return;++ final Uint8List pngBytes = byteData.buffer.asUint8List();+ final directory = await getTemporaryDirectory();+ final file = File('${directory.path}/${widget.shareFileName}');+ await file.writeAsBytes(pngBytes);++ final box = context.findRenderObject() as RenderBox?;+ final shareOrigin =+ box != null ? box.localToGlobal(Offset.zero) & box.size : null;++ await SharePlus.instance.share(+ ShareParams(+ files: [XFile(file.path)],+ text: widget.shareText,+ sharePositionOrigin: shareOrigin,+ ),+ );+ } catch (error) {+ debugPrint('Error sharing QR code: $error');+ }+ }++ PrettyQrDecoration _buildDefaultDecoration(Color finderColor) {+ return PrettyQrDecoration(+ shape: PrettyQrShape.custom(+ const PrettyQrDotsSymbol(+ color: _kDefaultQrTextColor,+ unifiedFinderPattern: false,+ unifiedAlignmentPatterns: false,+ ),+ finderPattern: PrettyQrSquaresSymbol(+ color: _kDefaultQrTextColor,+ rounding: 0.5,+ unifiedFinderPattern: true,+ finderPatternOuterThickness: 1.4,+ finderPatternOuterColor: finderColor,+ finderPatternInnerDotSize: 0.8,+ finderPatternInnerRounding: 1.0,+ ),+ alignmentPatterns: const PrettyQrSquaresSymbol(+ color: _kDefaultQrTextColor,+ rounding: 1.0,+ ),+ ),+ image: widget.logoAssetPath != null+ ? PrettyQrDecorationImage(+ image: AssetImage(widget.logoAssetPath!),+ scale: 0.25,+ padding: const EdgeInsets.all(24),+ position: PrettyQrDecorationImagePosition.embedded,+ )+ : null,+ background: Colors.transparent,+ quietZone: PrettyQrQuietZone.zero,+ );+ }++ Widget _buildBranding(QrBranding branding, Color color) {+ return switch (branding) {+ QrTextBranding(:final text, :final style) => Text(+ text,+ style: style.copyWith(color: style.color ?? color),+ ),+ QrSvgBranding(:final assetPath, :final height) => SvgPicture.asset(+ assetPath,+ height: height,+ colorFilter: ColorFilter.mode(color, BlendMode.srcIn),+ ),+ };+ }++ @override+ Widget build(BuildContext context) {+ final mediaQuery = MediaQuery.of(context);+ final theme = Theme.of(context);+ final isDark = theme.brightness == Brightness.dark;+ final double qrSize = min(+ mediaQuery.size.width - widget.horizontalPadding,+ widget.maxQrSize,+ );+ final double qrCodeSize = max(qrSize - 100, widget.minQrSize);++ final dialogBackgroundColor =+ widget.backgroundColor ?? theme.colorScheme.surface;+ final cardColor = widget.qrCardColor ?? _kDefaultQrBoxColor;+ final closeBgColor = widget.closeButtonBackgroundColor ??+ (isDark ? theme.colorScheme.surfaceContainerHighest : cardColor);+ final closeIconColor = widget.closeButtonIconColor ??+ (isDark ? theme.colorScheme.onSurface : _kDefaultQrTextColor);+ final shareButtonColor =+ widget.shareButtonBackgroundColor ?? widget.accentColor;++ final titleStyle = widget.titleTextStyle ?? _kDefaultTitleStyle;+ final subtitleStyle = widget.subtitleTextStyle ?? _kDefaultSubtitleStyle;+ final dialogTitleStyle = widget.dialogTitleTextStyle ??+ _kDefaultDialogTitleStyle.copyWith(+ color: theme.colorScheme.onSurface,+ );+ final shareButtonStyle =+ widget.shareButtonTextStyle ?? _kDefaultShareButtonStyle;++ final decoration =+ widget.decoration ?? _buildDefaultDecoration(widget.accentColor);++ return Dialog(+ shape: RoundedRectangleBorder(+ borderRadius: BorderRadius.circular(widget.backgroundBorderRadius),+ ),+ shadowColor: isDark+ ? Colors.black.withValues(alpha: 0.7)+ : Colors.grey.withValues(alpha: 0.5),+ child: Container(+ padding: const EdgeInsets.fromLTRB(20, 18, 20, 20),+ decoration: BoxDecoration(+ color: dialogBackgroundColor,+ borderRadius: BorderRadius.circular(widget.backgroundBorderRadius),+ border: isDark+ ? Border.all(+ color: Colors.white.withValues(alpha: 0.1),+ width: 1,+ )+ : null,+ ),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ Padding(+ padding: const EdgeInsets.only(left: 6, bottom: 4),+ child: Row(+ mainAxisAlignment: MainAxisAlignment.spaceBetween,+ children: [+ Text(widget.dialogTitle, style: dialogTitleStyle),+ GestureDetector(+ onTap: () => Navigator.of(context).pop(),+ child: Container(+ width: 36,+ height: 36,+ decoration: BoxDecoration(+ color: closeBgColor,+ borderRadius: BorderRadius.circular(18),+ ),+ child: Icon(+ Icons.close,+ size: 20,+ color: closeIconColor,+ ),+ ),+ ),+ ],+ ),+ ),+ const SizedBox(height: 8),+ RepaintBoundary(+ key: _qrKey,+ child: Container(+ width: double.infinity,+ padding: widget.qrCardPadding,+ decoration: BoxDecoration(+ color: cardColor,+ borderRadius: BorderRadius.circular(widget.cardBorderRadius),+ ),+ child: Stack(+ alignment: Alignment.center,+ children: [+ Column(+ mainAxisSize: MainAxisSize.min,+ crossAxisAlignment: CrossAxisAlignment.center,+ children: [+ SizedBox(+ width: widget.titleMaxWidth,+ child: Text(+ widget.title,+ textAlign: TextAlign.center,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: titleStyle,+ ),+ ),+ if (widget.subtitle != null &&+ widget.subtitle!.isNotEmpty)+ SizedBox(+ width: widget.subtitleMaxWidth,+ child: Text(+ widget.subtitle!,+ textAlign: TextAlign.center,+ maxLines: 1,+ overflow: TextOverflow.ellipsis,+ style: subtitleStyle,+ ),+ ),+ const SizedBox(height: 20),+ SizedBox(+ width: qrCodeSize,+ height: qrCodeSize,+ child: PrettyQrView(+ qrImage: QrImage(+ QrCode.fromData(+ data: widget.data,+ errorCorrectLevel: widget.errorCorrectionLevel,+ ),+ ),+ decoration: decoration,+ ),+ ),+ const SizedBox(height: 42),+ ],+ ),+ if (widget.branding != null)+ Positioned(+ bottom: 0,+ right: 2,+ child: _buildBranding(+ widget.branding!,+ widget.accentColor,+ ),+ ),+ ],+ ),+ ),+ ),+ const SizedBox(height: 24),+ GestureDetector(+ onTap: _shareQrCode,+ child: Container(+ width: double.infinity,+ padding: const EdgeInsets.symmetric(vertical: 14),+ decoration: BoxDecoration(+ color: shareButtonColor,+ borderRadius: BorderRadius.circular(12),+ ),+ child: Text(+ widget.shareButtonText,+ textAlign: TextAlign.center,+ style: shareButtonStyle,+ ),+ ),+ ),+ ],+ ),+ ),+ );+ }+}diff --git a/mobile/packages/qr/pubspec.lock b/mobile/packages/qr/pubspec.locknew file mode 100644index 0000000000..098b05a0e0--- /dev/null+++ b/mobile/packages/qr/pubspec.lock@@ -0,0 +1,414 @@+# Generated by pub+# See https://dart.dev/tools/pub/glossary#lockfile+packages:+ args:+ dependency: transitive+ description:+ name: args+ sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04+ url: "https://pub.dev"+ source: hosted+ version: "2.7.0"+ async:+ dependency: transitive+ description:+ name: async+ sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"+ url: "https://pub.dev"+ source: hosted+ version: "2.13.0"+ characters:+ dependency: transitive+ description:+ name: characters+ sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803+ url: "https://pub.dev"+ source: hosted+ version: "1.4.0"+ collection:+ dependency: transitive+ description:+ name: collection+ sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"+ url: "https://pub.dev"+ source: hosted+ version: "1.19.1"+ cross_file:+ dependency: transitive+ description:+ name: cross_file+ sha256: "701dcfc06da0882883a2657c445103380e53e647060ad8d9dfb710c100996608"+ url: "https://pub.dev"+ source: hosted+ version: "0.3.5+1"+ crypto:+ dependency: transitive+ description:+ name: crypto+ sha256: c8ea0233063ba03258fbcf2ca4d6dadfefe14f02fab57702265467a19f27fadf+ url: "https://pub.dev"+ source: hosted+ version: "3.0.7"+ ffi:+ dependency: transitive+ description:+ name: ffi+ sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.4"+ file:+ dependency: transitive+ description:+ name: file+ sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4+ url: "https://pub.dev"+ source: hosted+ version: "7.0.1"+ fixnum:+ dependency: transitive+ description:+ name: fixnum+ sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be+ url: "https://pub.dev"+ source: hosted+ version: "1.1.1"+ flutter:+ dependency: "direct main"+ description: flutter+ source: sdk+ version: "0.0.0"+ flutter_lints:+ dependency: "direct dev"+ description:+ name: flutter_lints+ sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1"+ url: "https://pub.dev"+ source: hosted+ version: "5.0.0"+ flutter_svg:+ dependency: "direct main"+ description:+ name: flutter_svg+ sha256: "87fbd7c534435b6c5d9d98b01e1fd527812b82e68ddd8bd35fc45ed0fa8f0a95"+ url: "https://pub.dev"+ source: hosted+ version: "2.2.3"+ flutter_web_plugins:+ dependency: transitive+ description: flutter+ source: sdk+ version: "0.0.0"+ http:+ dependency: transitive+ description:+ name: http+ sha256: "87721a4a50b19c7f1d49001e51409bddc46303966ce89a65af4f4e6004896412"+ url: "https://pub.dev"+ source: hosted+ version: "1.6.0"+ http_parser:+ dependency: transitive+ description:+ name: http_parser+ sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571"+ url: "https://pub.dev"+ source: hosted+ version: "4.1.2"+ lints:+ dependency: transitive+ description:+ name: lints+ sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7+ url: "https://pub.dev"+ source: hosted+ version: "5.1.1"+ material_color_utilities:+ dependency: transitive+ description:+ name: material_color_utilities+ sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec+ url: "https://pub.dev"+ source: hosted+ version: "0.11.1"+ meta:+ dependency: transitive+ description:+ name: meta+ sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c+ url: "https://pub.dev"+ source: hosted+ version: "1.16.0"+ mime:+ dependency: transitive+ description:+ name: mime+ sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6"+ url: "https://pub.dev"+ source: hosted+ version: "2.0.0"+ path:+ dependency: transitive+ description:+ name: path+ sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"+ url: "https://pub.dev"+ source: hosted+ version: "1.9.1"+ path_parsing:+ dependency: transitive+ description:+ name: path_parsing+ sha256: "883402936929eac138ee0a45da5b0f2c80f89913e6dc3bf77eb65b84b409c6ca"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ path_provider:+ dependency: "direct main"+ description:+ name: path_provider+ sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.5"+ path_provider_android:+ dependency: transitive+ description:+ name: path_provider_android+ sha256: "3b4c1fc3aa55ddc9cd4aa6759984330d5c8e66aa7702a6223c61540dc6380c37"+ url: "https://pub.dev"+ source: hosted+ version: "2.2.19"+ path_provider_foundation:+ dependency: transitive+ description:+ name: path_provider_foundation+ sha256: "16eef174aacb07e09c351502740fa6254c165757638eba1e9116b0a781201bbd"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.2"+ path_provider_linux:+ dependency: transitive+ description:+ name: path_provider_linux+ sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279+ url: "https://pub.dev"+ source: hosted+ version: "2.2.1"+ path_provider_platform_interface:+ dependency: transitive+ description:+ name: path_provider_platform_interface+ sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.2"+ path_provider_windows:+ dependency: transitive+ description:+ name: path_provider_windows+ sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7+ url: "https://pub.dev"+ source: hosted+ version: "2.3.0"+ petitparser:+ dependency: transitive+ description:+ name: petitparser+ sha256: "1a97266a94f7350d30ae522c0af07890c70b8e62c71e8e3920d1db4d23c057d1"+ url: "https://pub.dev"+ source: hosted+ version: "7.0.1"+ platform:+ dependency: transitive+ description:+ name: platform+ sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"+ url: "https://pub.dev"+ source: hosted+ version: "3.1.6"+ plugin_platform_interface:+ dependency: transitive+ description:+ name: plugin_platform_interface+ sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.8"+ pretty_qr_code:+ dependency: "direct main"+ description:+ path: "."+ ref: HEAD+ resolved-ref: "80ebafb9c99ac22520092b008579013d2fcffbe1"+ url: "https://github.com/ente-io/flutter_pretty_qr_fork"+ source: git+ version: "3.5.0"+ qr:+ dependency: transitive+ description:+ name: qr+ sha256: "5a1d2586170e172b8a8c8470bbbffd5eb0cd38a66c0d77155ea138d3af3a4445"+ url: "https://pub.dev"+ source: hosted+ version: "3.0.2"+ share_plus:+ dependency: "direct main"+ description:+ name: share_plus+ sha256: d7dc0630a923883c6328ca31b89aa682bacbf2f8304162d29f7c6aaff03a27a1+ url: "https://pub.dev"+ source: hosted+ version: "11.1.0"+ share_plus_platform_interface:+ dependency: transitive+ description:+ name: share_plus_platform_interface+ sha256: "88023e53a13429bd65d8e85e11a9b484f49d4c190abbd96c7932b74d6927cc9a"+ url: "https://pub.dev"+ source: hosted+ version: "6.1.0"+ sky_engine:+ dependency: transitive+ description: flutter+ source: sdk+ version: "0.0.0"+ source_span:+ dependency: transitive+ description:+ name: source_span+ sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"+ url: "https://pub.dev"+ source: hosted+ version: "1.10.1"+ string_scanner:+ dependency: transitive+ description:+ name: string_scanner+ sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"+ url: "https://pub.dev"+ source: hosted+ version: "1.4.1"+ term_glyph:+ dependency: transitive+ description:+ name: term_glyph+ sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"+ url: "https://pub.dev"+ source: hosted+ version: "1.2.2"+ typed_data:+ dependency: transitive+ description:+ name: typed_data+ sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006+ url: "https://pub.dev"+ source: hosted+ version: "1.4.0"+ url_launcher_linux:+ dependency: transitive+ description:+ name: url_launcher_linux+ sha256: d5e14138b3bc193a0f63c10a53c94b91d399df0512b1f29b94a043db7482384a+ url: "https://pub.dev"+ source: hosted+ version: "3.2.2"+ url_launcher_platform_interface:+ dependency: transitive+ description:+ name: url_launcher_platform_interface+ sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"+ url: "https://pub.dev"+ source: hosted+ version: "2.3.2"+ url_launcher_web:+ dependency: transitive+ description:+ name: url_launcher_web+ sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2"+ url: "https://pub.dev"+ source: hosted+ version: "2.4.1"+ url_launcher_windows:+ dependency: transitive+ description:+ name: url_launcher_windows+ sha256: "712c70ab1b99744ff066053cbe3e80c73332b38d46e5e945c98689b2e66fc15f"+ url: "https://pub.dev"+ source: hosted+ version: "3.1.5"+ uuid:+ dependency: transitive+ description:+ name: uuid+ sha256: a11b666489b1954e01d992f3d601b1804a33937b5a8fe677bd26b8a9f96f96e8+ url: "https://pub.dev"+ source: hosted+ version: "4.5.2"+ vector_graphics:+ dependency: transitive+ description:+ name: vector_graphics+ sha256: a4f059dc26fc8295b5921376600a194c4ec7d55e72f2fe4c7d2831e103d461e6+ url: "https://pub.dev"+ source: hosted+ version: "1.1.19"+ vector_graphics_codec:+ dependency: transitive+ description:+ name: vector_graphics_codec+ sha256: "99fd9fbd34d9f9a32efd7b6a6aae14125d8237b10403b422a6a6dfeac2806146"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.13"+ vector_graphics_compiler:+ dependency: transitive+ description:+ name: vector_graphics_compiler+ sha256: d354a7ec6931e6047785f4db12a1f61ec3d43b207fc0790f863818543f8ff0dc+ url: "https://pub.dev"+ source: hosted+ version: "1.1.19"+ vector_math:+ dependency: transitive+ description:+ name: vector_math+ sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"+ url: "https://pub.dev"+ source: hosted+ version: "2.1.4"+ web:+ dependency: transitive+ description:+ name: web+ sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.1"+ win32:+ dependency: transitive+ description:+ name: win32+ sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e+ url: "https://pub.dev"+ source: hosted+ version: "5.15.0"+ xdg_directories:+ dependency: transitive+ description:+ name: xdg_directories+ sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ xml:+ dependency: transitive+ description:+ name: xml+ sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025"+ url: "https://pub.dev"+ source: hosted+ version: "6.6.1"+sdks:+ dart: ">=3.8.0 <4.0.0"+ flutter: ">=3.32.0"diff --git a/mobile/packages/qr/pubspec.yaml b/mobile/packages/qr/pubspec.yamlnew file mode 100644index 0000000000..99f5009675--- /dev/null+++ b/mobile/packages/qr/pubspec.yaml@@ -0,0 +1,23 @@+name: ente_qr_ui+description: Shared QR code utilities for Ente mobile apps+version: 0.0.1+publish_to: none++environment:+ sdk: ">=3.0.0 <4.0.0"+ flutter: ">=3.22.0"++dependencies:+ flutter:+ sdk: flutter+ flutter_svg: ^2.0.10+1+ path_provider: ^2.0.11+ pretty_qr_code:+ git:+ url: https://github.com/ente-io/flutter_pretty_qr_fork+ share_plus: ^11.0.0++dev_dependencies:+ flutter_lints: ^5.0.0++flutter: {}