API fixes (against vendored enough_mail 2.1.7): - listMailboxes() returns List<Mailbox> directly — remove .mailboxes - Use statusMailbox() for unread/total counts per mailbox - fetchMessages(MessageSequence.fromAll(), ...) replaces nonexistent fetchAllMessages(); fetchMessage() takes isUidSequence flag - FetchImapResult.messages are already MimeMessages — no need to re-parse rawData; use msg.decodeTextPlainPart() / decodeTextHtmlPart() - msg.hasAttachments() (method) not msg.body?.hasAttachments (field) - SmtpClient clientDomain = sender domain, not display name; quit() instead of nonexistent disconnect(); STARTTLS wrapped in try/catch - ContentInfo.size is nullable; use a.fileName / a.size getters Other fixes: - main.dart: move sync start to initState, not build() - account_list_screen: remove dead/invalid Riverpod select() code - account_sync_manager: subscribe to account changes; cancel sub on dispose; use Future.any([newMsg, 25-min timeout]) for IDLE - email_repository: add getEmail(id) to interface + impl - email_detail_screen: load header + body together via Future.wait; reply prefills To/Cc/Subject correctly - compose_screen + router: thread prefillCc through Add Linux desktop entry point: - linux/CMakeLists.txt, main.cc, my_application.h/.cc (GTK3 runner) Add flake.lock (generated by nix flake update). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
66 lines
2.0 KiB
Dart
66 lines
2.0 KiB
Dart
import 'package:go_router/go_router.dart';
|
|
|
|
import 'screens/account_list_screen.dart';
|
|
import 'screens/add_account_screen.dart';
|
|
import 'screens/mailbox_list_screen.dart';
|
|
import 'screens/email_list_screen.dart';
|
|
import 'screens/email_detail_screen.dart';
|
|
import 'screens/compose_screen.dart';
|
|
import 'screens/settings_screen.dart';
|
|
|
|
final router = GoRouter(
|
|
initialLocation: '/accounts',
|
|
routes: [
|
|
GoRoute(
|
|
path: '/accounts',
|
|
builder: (ctx, state) => const AccountListScreen(),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'add',
|
|
builder: (ctx, state) => const AddAccountScreen(),
|
|
),
|
|
GoRoute(
|
|
path: ':accountId/mailboxes',
|
|
builder: (ctx, state) =>
|
|
MailboxListScreen(accountId: state.pathParameters['accountId']!),
|
|
routes: [
|
|
GoRoute(
|
|
path: ':mailboxPath/emails',
|
|
builder: (ctx, state) => EmailListScreen(
|
|
accountId: state.pathParameters['accountId']!,
|
|
mailboxPath: state.pathParameters['mailboxPath']!,
|
|
),
|
|
routes: [
|
|
GoRoute(
|
|
path: ':emailId',
|
|
builder: (ctx, state) => EmailDetailScreen(
|
|
emailId: state.pathParameters['emailId']!,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
],
|
|
),
|
|
GoRoute(
|
|
path: '/compose',
|
|
builder: (ctx, state) {
|
|
final extra = state.extra as Map<String, dynamic>?;
|
|
return ComposeScreen(
|
|
accountId: extra?['accountId'] as String?,
|
|
replyToEmailId: extra?['replyToEmailId'] as String?,
|
|
prefillTo: extra?['prefillTo'] as String?,
|
|
prefillCc: extra?['prefillCc'] as String?,
|
|
prefillSubject: extra?['prefillSubject'] as String?,
|
|
prefillBody: extra?['prefillBody'] as String?,
|
|
);
|
|
},
|
|
),
|
|
GoRoute(
|
|
path: '/settings',
|
|
builder: (ctx, state) => const SettingsScreen(),
|
|
),
|
|
],
|
|
);
|