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

View file

@ -6,6 +6,7 @@ import "package:smol_mail/data/providers/providers.dart";
import "package:smol_mail/presentation/routes/app_router.gr.dart";
import "package:smol_mail/presentation/widgets/image_banner.dart";
import "package:smol_mail/presentation/widgets/message/message_list.dart";
import "package:smol_mail/presentation/widgets/qr_code_sheet.dart";
import "package:smol_mail/shared/utils/snackbar.dart";
import "package:smol_mail/smol/errors.dart";
@ -90,11 +91,24 @@ class _InboxScreenState extends ConsumerState<InboxScreen>
final unread = ref.watch(unreadProvider);
final requestsUnread = ref.watch(requestsUnreadProvider);
final canFetch = _folders[_tabController.index] != "sent";
// The same self-certifying URI the settings share row shows, one tap
// closer: what a second device scans to import this identity.
final me = ref.watch(identityProvider);
final account = ref.watch(accountProvider);
final share = (me == null || account == null)
? null
: account.uri(me.publicKey);
return Scaffold(
appBar: AppBar(
title: const Text("kirakira"),
actions: [
if (share != null)
IconButton(
tooltip: "Show QR code",
onPressed: () => showQrCodeSheet(context, share),
icon: const Icon(Icons.qr_code),
),
if (canFetch)
IconButton(
tooltip: "Fetch",