Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix pubspec changes and use theme text styles in qr_code_dialog

Prateek Sunala865f6d2ea79
diff --git a/mobile/apps/auth/pubspec.lock b/mobile/apps/auth/pubspec.lock
index 9be5cde48f..b0d265062c 100644
--- a/mobile/apps/auth/pubspec.lock
+++ b/mobile/apps/auth/pubspec.lock
@@ -1357,7 +1357,7 @@ packages:
source: hosted
version: "6.0.3"
pretty_qr_code:
- dependency: "direct main"
+ dependency: transitive
description:
path: "."
ref: HEAD
diff --git a/mobile/apps/auth/pubspec.yaml b/mobile/apps/auth/pubspec.yaml
index 92c1ed9cc0..4ae1dd1366 100644
--- a/mobile/apps/auth/pubspec.yaml
+++ b/mobile/apps/auth/pubspec.yaml
@@ -117,7 +117,6 @@ dependencies:
path_provider: ^2.0.11
pinput: ^5.0.0
pointycastle: ^3.7.3
-
privacy_screen: ^0.0.6
protobuf: ^4.1.0
qr_code_scanner: # no package updates on pub.dev
diff --git a/mobile/apps/photos/lib/utils/email_util.dart b/mobile/apps/photos/lib/utils/email_util.dart
index b9ca96e82d..e4a3512d3d 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,
- fileExtension: 'zip',
+ ext: 'zip',
);
} else {
await SharePlus.instance.share(
diff --git a/mobile/apps/photos/pubspec.yaml b/mobile/apps/photos/pubspec.yaml
index 2a06e85557..be260fe01a 100644
--- a/mobile/apps/photos/pubspec.yaml
+++ b/mobile/apps/photos/pubspec.yaml
@@ -77,7 +77,7 @@ dependencies:
path: flutter/flutter
ref: remove-event-sub
figma_squircle: ^0.6.3
- file_saver: ^0.3.1
+ file_saver: ^0.2.14
firebase_core: ^3.6.0
firebase_messaging: ^15.1.3
fixnum: ^1.1.1
@@ -111,7 +111,7 @@ dependencies:
flutter_timezone: ^4.1.0
fluttertoast: ^8.0.6
fraction: ^5.0.2
- freezed_annotation: ">=2.4.1 <4.0.0"
+ freezed_annotation: ^3.0.0
home_widget: ^0.8.0
html_unescape: ^2.0.0
http: ^1.1.0
@@ -181,7 +181,6 @@ dependencies:
photo_view: ^0.15.0
pinput: ^5.0.0
pointycastle: ^3.7.3
-
privacy_screen: # pub.dev is behind
git:
url: https://github.com/ente-io/privacy_screen.git
diff --git a/mobile/packages/qr/lib/qr_code_dialog.dart b/mobile/packages/qr/lib/qr_code_dialog.dart
index 7412534866..90e66f8f2f 100644
--- a/mobile/packages/qr/lib/qr_code_dialog.dart
+++ b/mobile/packages/qr/lib/qr_code_dialog.dart
@@ -12,31 +12,6 @@ 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();
@@ -115,14 +90,14 @@ class QrCodeDialog extends StatefulWidget {
this.closeButtonBackgroundColor,
this.closeButtonIconColor,
this.shareButtonBackgroundColor,
- this.qrCardPadding = const EdgeInsets.fromLTRB(20, 20, 20, 12),
+ this.qrCardPadding = const EdgeInsets.all(20),
this.backgroundBorderRadius = 24,
this.cardBorderRadius = 22,
this.horizontalPadding = 80,
this.maxQrSize = 300,
this.minQrSize = 150,
- this.titleMaxWidth = 225,
- this.subtitleMaxWidth = 175,
+ this.titleMaxWidth = 224,
+ this.subtitleMaxWidth = 176,
this.dialogTitleTextStyle,
this.titleTextStyle,
this.subtitleTextStyle,
@@ -221,12 +196,15 @@ class _QrCodeDialogState extends State<QrCodeDialog> {
Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context);
final theme = Theme.of(context);
+ final textTheme = theme.textTheme;
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);
+ // Round to nearest even number for crisp rendering
+ final double qrCodeSizeEven = (qrCodeSize / 2).round() * 2.0;
final dialogBackgroundColor =
widget.backgroundColor ?? theme.colorScheme.surface;
@@ -238,14 +216,33 @@ class _QrCodeDialogState extends State<QrCodeDialog> {
final shareButtonColor =
widget.shareButtonBackgroundColor ?? widget.accentColor;
- final titleStyle = widget.titleTextStyle ?? _kDefaultTitleStyle;
- final subtitleStyle = widget.subtitleTextStyle ?? _kDefaultSubtitleStyle;
+ // Use theme text styles with copyWith for customization
+ final titleStyle = widget.titleTextStyle ??
+ textTheme.titleMedium?.copyWith(
+ fontSize: 18,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.5,
+ color: _kDefaultQrTextColor,
+ );
+ final subtitleStyle = widget.subtitleTextStyle ??
+ textTheme.bodySmall?.copyWith(
+ fontSize: 12,
+ fontWeight: FontWeight.w600,
+ letterSpacing: -0.5,
+ color: _kDefaultQrTextColor.withValues(alpha: 0.6),
+ );
final dialogTitleStyle = widget.dialogTitleTextStyle ??
- _kDefaultDialogTitleStyle.copyWith(
+ textTheme.titleLarge?.copyWith(
+ fontSize: 20,
+ fontWeight: FontWeight.w700,
color: theme.colorScheme.onSurface,
);
- final shareButtonStyle =
- widget.shareButtonTextStyle ?? _kDefaultShareButtonStyle;
+ final shareButtonStyle = widget.shareButtonTextStyle ??
+ textTheme.labelLarge?.copyWith(
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ color: Colors.white,
+ );
final decoration =
widget.decoration ?? _buildDefaultDecoration(widget.accentColor);
@@ -271,7 +268,7 @@ class _QrCodeDialogState extends State<QrCodeDialog> {
: null,
),
child: SingleChildScrollView(
- padding: const EdgeInsets.fromLTRB(20, 18, 20, 20),
+ padding: const EdgeInsets.all(20),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -342,8 +339,8 @@ class _QrCodeDialogState extends State<QrCodeDialog> {
),
const SizedBox(height: 20),
SizedBox(
- width: qrCodeSize,
- height: qrCodeSize,
+ width: qrCodeSizeEven,
+ height: qrCodeSizeEven,
child: PrettyQrView(
qrImage: QrImage(
QrCode.fromData(