feat: support smol:// QR sharing, deep links and in-dialog scanning

This commit is contained in:
randogoth 2026-09-30 17:14:47 +03:00
parent 7d2a147fec
commit aa74e12ee7
20 changed files with 591 additions and 101 deletions

28
test/qr_sheet_test.dart Normal file
View file

@ -0,0 +1,28 @@
import "package:flutter/material.dart";
import "package:flutter_test/flutter_test.dart";
import "package:qr_flutter/qr_flutter.dart";
import "package:smol_mail/presentation/theme/theme.dart";
import "package:smol_mail/presentation/widgets/qr_code_sheet.dart";
void main() {
testWidgets("the sheet renders the payload as a scannable QR code",
(tester) async {
const payload = "smol://alice@example.org/lm2gqd7e5q67xq3isc5hx6jfj2q7a7xvq4l7trctxipudujovmgq";
await tester.pumpWidget(
MaterialApp(
theme: appThemeLight,
home: Builder(
builder: (context) => TextButton(
onPressed: () => showQrCodeSheet(context, payload),
child: const Text("show"),
),
),
),
);
await tester.tap(find.text("show"));
await tester.pumpAndSettle();
expect(find.byType(QrImageView), findsOneWidget);
expect(find.text(payload), findsOneWidget);
});
}