Skip to content

armgit / ente

Public Imported from GitHub
0

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

Wrap Legacy PDF recovery codes automatically

Manav Rathi49129c3326da
diff --git a/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart b/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart
index 58cbb39660..c7380917fd 100644
--- a/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart
+++ b/mobile/packages/legacy/lib/services/legacy_kit_pdf_service.dart
@@ -377,28 +377,15 @@ class LegacyKitPdfService {
fit: pw.BoxFit.scaleDown,
child: pw.SizedBox(
width: 207,
- child: pw.Column(
- mainAxisSize: pw.MainAxisSize.min,
- children: _displayCopyCodeLines(copyCode)
- .map(
- (line) => pw.SizedBox(
- height: 22,
- child: pw.Center(
- child: pw.Text(
- line,
- textAlign: pw.TextAlign.center,
- softWrap: false,
- maxLines: 1,
- style: pw.TextStyle(
- color: _black,
- fontSize: 12,
- font: assets.outfitMedium,
- ),
- ),
- ),
- ),
- )
- .toList(growable: false),
+ child: pw.Text(
+ copyCode,
+ textAlign: pw.TextAlign.center,
+ style: pw.TextStyle(
+ color: _black,
+ fontSize: 12,
+ font: assets.outfitMedium,
+ lineSpacing: 6,
+ ),
),
),
),
@@ -617,19 +604,6 @@ class LegacyKitPdfService {
);
}
- List<String> _displayCopyCodeLines(String copyCode) {
- const chunkSize = 28;
- return [
- for (var index = 0; index < copyCode.length; index += chunkSize)
- copyCode.substring(
- index,
- index + chunkSize > copyCode.length
- ? copyCode.length
- : index + chunkSize,
- ),
- ];
- }
-
List<LegacyKitShare> _sortedShares(List<LegacyKitShare> shares) {
return shares.toList(growable: false)
..sort((a, b) => a.shareIndex.compareTo(b.shareIndex));