From 0062d3baf0f2eac26b75733e81d26a4e086b5e44 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 25 Jun 2025 17:56:08 +0800 Subject: [PATCH] :sparkles: Receving share from system --- ios/Runner.xcodeproj/project.pbxproj | 6 + .../SolianNotificationService.entitlements | 10 + .../SolianShareExtension.entitlements | 10 + lib/main.dart | 11 +- lib/route.dart | 28 +- lib/route.gr.dart | 619 +++++++++--------- lib/services/compose_storage_db.g.dart | 2 +- lib/services/sharing_intent.dart | 91 +++ lib/widgets/app_wrapper.dart | 23 + 9 files changed, 482 insertions(+), 318 deletions(-) create mode 100644 ios/SolianNotificationService/SolianNotificationService.entitlements create mode 100644 ios/SolianShareExtension/SolianShareExtension.entitlements create mode 100644 lib/services/sharing_intent.dart create mode 100644 lib/widgets/app_wrapper.dart diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 48f9660..251b90d 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -846,6 +846,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = SolianShareExtension/SolianShareExtension.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; CUSTOM_GROUP_ID = group.solsynth.solian; @@ -888,6 +889,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = SolianShareExtension/SolianShareExtension.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; CUSTOM_GROUP_ID = group.solsynth.solian; @@ -927,6 +929,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = SolianShareExtension/SolianShareExtension.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; CUSTOM_GROUP_ID = group.solsynth.solian; @@ -966,6 +969,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = SolianNotificationService/SolianNotificationService.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = W7HPZ53V6B; @@ -1007,6 +1011,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = SolianNotificationService/SolianNotificationService.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = W7HPZ53V6B; @@ -1045,6 +1050,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_ENTITLEMENTS = SolianNotificationService/SolianNotificationService.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = W7HPZ53V6B; diff --git a/ios/SolianNotificationService/SolianNotificationService.entitlements b/ios/SolianNotificationService/SolianNotificationService.entitlements new file mode 100644 index 0000000..7121c32 --- /dev/null +++ b/ios/SolianNotificationService/SolianNotificationService.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.solsynth.solian + + + diff --git a/ios/SolianShareExtension/SolianShareExtension.entitlements b/ios/SolianShareExtension/SolianShareExtension.entitlements new file mode 100644 index 0000000..7121c32 --- /dev/null +++ b/ios/SolianShareExtension/SolianShareExtension.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.application-groups + + group.solsynth.solian + + + diff --git a/lib/main.dart b/lib/main.dart index fa45fbc..c506283 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,6 +19,7 @@ import 'package:island/pods/userinfo.dart'; import 'package:island/pods/websocket.dart'; import 'package:island/route.dart'; import 'package:island/services/notify.dart'; +import 'package:island/widgets/app_wrapper.dart'; import 'package:island/services/timezone.dart'; import 'package:island/widgets/alert.dart'; import 'package:island/widgets/app_scaffold.dart'; @@ -60,11 +61,11 @@ void main() async { if (!kIsWeb && (Platform.isMacOS || Platform.isLinux || Platform.isWindows)) { doWhenWindowReady(() { const defaultSize = Size(360, 640); - + // Get saved window size from preferences final savedSizeString = prefs.getString(kAppWindowSize); Size initialSize = defaultSize; - + if (savedSizeString != null) { try { final parts = savedSizeString.split(','); @@ -78,12 +79,14 @@ void main() async { initialSize = defaultSize; } } - + appWindow.minSize = defaultSize; appWindow.size = initialSize; appWindow.alignment = Alignment.center; appWindow.show(); - log("[SplashScreen] Desktop window is ready with size: ${initialSize.width}x${initialSize.height}"); + log( + "[SplashScreen] Desktop window is ready with size: ${initialSize.width}x${initialSize.height}", + ); }); } diff --git a/lib/route.dart b/lib/route.dart index 559ee06..5d75879 100644 --- a/lib/route.dart +++ b/lib/route.dart @@ -8,13 +8,17 @@ class AppRouter extends RootStackRouter { @override List get routes => [ - AutoRoute(page: PostComposeRoute.page, path: '/posts/compose'), - AutoRoute(page: PostEditRoute.page, path: '/posts/:id/edit'), - AutoRoute(page: CallRoute.page, path: '/chat/:id/call'), - AutoRoute(page: EventCalanderRoute.page, path: '/account/:name/calendar'), + AutoRoute(path: '/', page: AppWrapper.page, children: _appRoutes), + ]; + + List get _appRoutes => [ + AutoRoute(page: PostComposeRoute.page, path: 'posts/compose'), + AutoRoute(page: PostEditRoute.page, path: 'posts/:id/edit'), + AutoRoute(page: CallRoute.page, path: 'chat/:id/call'), + AutoRoute(page: EventCalanderRoute.page, path: 'account/:name/calendar'), AutoRoute( page: TabsRoute.page, - path: '/', + path: '', children: [ AutoRoute( page: ExploreShellRoute.page, @@ -58,7 +62,7 @@ class AppRouter extends RootStackRouter { ), AutoRoute( page: CreatorHubShellRoute.page, - path: '/creators', + path: 'creators', children: [ AutoRoute(page: CreatorHubRoute.page, path: ''), AutoRoute(page: CreatorPostListRoute.page, path: ':name/posts'), @@ -81,11 +85,11 @@ class AppRouter extends RootStackRouter { AutoRoute(page: EditPublisherRoute.page, path: ':name/edit'), ], ), - AutoRoute(page: LoginRoute.page, path: '/auth/login'), - AutoRoute(page: CreateAccountRoute.page, path: '/auth/create-account'), - AutoRoute(page: SettingsRoute.page, path: '/settings'), - AutoRoute(page: NewRealmRoute.page, path: '/realms/new'), - AutoRoute(page: RealmDetailRoute.page, path: '/realms/:slug'), - AutoRoute(page: EditRealmRoute.page, path: '/realms/:slug/edit'), + AutoRoute(page: LoginRoute.page, path: 'auth/login'), + AutoRoute(page: CreateAccountRoute.page, path: 'auth/create-account'), + AutoRoute(page: SettingsRoute.page, path: 'settings'), + AutoRoute(page: NewRealmRoute.page, path: 'realms/new'), + AutoRoute(page: RealmDetailRoute.page, path: 'realms/:slug'), + AutoRoute(page: EditRealmRoute.page, path: 'realms/:slug/edit'), ]; } diff --git a/lib/route.gr.dart b/lib/route.gr.dart index 1376f14..c18b484 100644 --- a/lib/route.gr.dart +++ b/lib/route.gr.dart @@ -9,47 +9,48 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i30; -import 'package:flutter/foundation.dart' as _i32; -import 'package:flutter/material.dart' as _i31; -import 'package:island/models/post.dart' as _i33; +import 'package:auto_route/auto_route.dart' as _i31; +import 'package:flutter/foundation.dart' as _i33; +import 'package:flutter/material.dart' as _i32; +import 'package:island/models/post.dart' as _i34; import 'package:island/screens/account.dart' as _i2; -import 'package:island/screens/account/event_calendar.dart' as _i16; -import 'package:island/screens/account/leveling.dart' as _i18; +import 'package:island/screens/account/event_calendar.dart' as _i17; +import 'package:island/screens/account/leveling.dart' as _i19; import 'package:island/screens/account/me/settings.dart' as _i3; -import 'package:island/screens/account/me/update.dart' as _i28; +import 'package:island/screens/account/me/update.dart' as _i29; import 'package:island/screens/account/profile.dart' as _i1; -import 'package:island/screens/account/relationship.dart' as _i25; -import 'package:island/screens/auth/create_account.dart' as _i9; -import 'package:island/screens/auth/login.dart' as _i19; -import 'package:island/screens/chat/call.dart' as _i5; -import 'package:island/screens/chat/chat.dart' as _i7; -import 'package:island/screens/chat/room.dart' as _i8; -import 'package:island/screens/chat/room_detail.dart' as _i6; -import 'package:island/screens/creators/hub.dart' as _i10; -import 'package:island/screens/creators/posts/list.dart' as _i11; -import 'package:island/screens/creators/publishers.dart' as _i12; -import 'package:island/screens/creators/stickers/pack_detail.dart' as _i15; -import 'package:island/screens/creators/stickers/stickers.dart' as _i14; -import 'package:island/screens/explore.dart' as _i17; -import 'package:island/screens/notification.dart' as _i20; -import 'package:island/screens/posts/compose.dart' as _i21; -import 'package:island/screens/posts/compose_article.dart' as _i4; -import 'package:island/screens/posts/detail.dart' as _i22; -import 'package:island/screens/posts/pub_profile.dart' as _i23; -import 'package:island/screens/realm/detail.dart' as _i24; -import 'package:island/screens/realm/realms.dart' as _i13; -import 'package:island/screens/settings.dart' as _i26; -import 'package:island/screens/tabs.dart' as _i27; -import 'package:island/screens/wallet.dart' as _i29; +import 'package:island/screens/account/relationship.dart' as _i26; +import 'package:island/screens/auth/create_account.dart' as _i10; +import 'package:island/screens/auth/login.dart' as _i20; +import 'package:island/screens/chat/call.dart' as _i6; +import 'package:island/screens/chat/chat.dart' as _i8; +import 'package:island/screens/chat/room.dart' as _i9; +import 'package:island/screens/chat/room_detail.dart' as _i7; +import 'package:island/screens/creators/hub.dart' as _i11; +import 'package:island/screens/creators/posts/list.dart' as _i12; +import 'package:island/screens/creators/publishers.dart' as _i13; +import 'package:island/screens/creators/stickers/pack_detail.dart' as _i16; +import 'package:island/screens/creators/stickers/stickers.dart' as _i15; +import 'package:island/screens/explore.dart' as _i18; +import 'package:island/screens/notification.dart' as _i21; +import 'package:island/screens/posts/compose.dart' as _i22; +import 'package:island/screens/posts/compose_article.dart' as _i5; +import 'package:island/screens/posts/detail.dart' as _i23; +import 'package:island/screens/posts/pub_profile.dart' as _i24; +import 'package:island/screens/realm/detail.dart' as _i25; +import 'package:island/screens/realm/realms.dart' as _i14; +import 'package:island/screens/settings.dart' as _i27; +import 'package:island/screens/tabs.dart' as _i28; +import 'package:island/screens/wallet.dart' as _i30; +import 'package:island/widgets/app_wrapper.dart' as _i4; /// generated route for /// [_i1.AccountProfileScreen] -class AccountProfileRoute extends _i30.PageRouteInfo { +class AccountProfileRoute extends _i31.PageRouteInfo { AccountProfileRoute({ - _i31.Key? key, + _i32.Key? key, required String name, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( AccountProfileRoute.name, args: AccountProfileRouteArgs(key: key, name: name), @@ -59,7 +60,7 @@ class AccountProfileRoute extends _i30.PageRouteInfo { static const String name = 'AccountProfileRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -75,7 +76,7 @@ class AccountProfileRoute extends _i30.PageRouteInfo { class AccountProfileRouteArgs { const AccountProfileRouteArgs({this.key, required this.name}); - final _i31.Key? key; + final _i32.Key? key; final String name; @@ -97,11 +98,11 @@ class AccountProfileRouteArgs { /// generated route for /// [_i2.AccountScreen] -class AccountRoute extends _i30.PageRouteInfo { +class AccountRoute extends _i31.PageRouteInfo { AccountRoute({ - _i32.Key? key, + _i33.Key? key, bool isAside = false, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( AccountRoute.name, args: AccountRouteArgs(key: key, isAside: isAside), @@ -110,7 +111,7 @@ class AccountRoute extends _i30.PageRouteInfo { static const String name = 'AccountRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final args = data.argsAs( @@ -124,7 +125,7 @@ class AccountRoute extends _i30.PageRouteInfo { class AccountRouteArgs { const AccountRouteArgs({this.key, this.isAside = false}); - final _i32.Key? key; + final _i33.Key? key; final bool isAside; @@ -146,13 +147,13 @@ class AccountRouteArgs { /// generated route for /// [_i3.AccountSettingsScreen] -class AccountSettingsRoute extends _i30.PageRouteInfo { - const AccountSettingsRoute({List<_i30.PageRouteInfo>? children}) +class AccountSettingsRoute extends _i31.PageRouteInfo { + const AccountSettingsRoute({List<_i31.PageRouteInfo>? children}) : super(AccountSettingsRoute.name, initialChildren: children); static const String name = 'AccountSettingsRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { return const _i3.AccountSettingsScreen(); @@ -162,13 +163,13 @@ class AccountSettingsRoute extends _i30.PageRouteInfo { /// generated route for /// [_i2.AccountShellScreen] -class AccountShellRoute extends _i30.PageRouteInfo { - const AccountShellRoute({List<_i30.PageRouteInfo>? children}) +class AccountShellRoute extends _i31.PageRouteInfo { + const AccountShellRoute({List<_i31.PageRouteInfo>? children}) : super(AccountShellRoute.name, initialChildren: children); static const String name = 'AccountShellRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { return const _i2.AccountShellScreen(); @@ -177,12 +178,28 @@ class AccountShellRoute extends _i30.PageRouteInfo { } /// generated route for -/// [_i4.ArticleComposeScreen] -class ArticleComposeRoute extends _i30.PageRouteInfo { +/// [_i4.AppWrapper] +class AppWrapper extends _i31.PageRouteInfo { + const AppWrapper({List<_i31.PageRouteInfo>? children}) + : super(AppWrapper.name, initialChildren: children); + + static const String name = 'AppWrapper'; + + static _i31.PageInfo page = _i31.PageInfo( + name, + builder: (data) { + return const _i4.AppWrapper(); + }, + ); +} + +/// generated route for +/// [_i5.ArticleComposeScreen] +class ArticleComposeRoute extends _i31.PageRouteInfo { ArticleComposeRoute({ - _i31.Key? key, - _i33.SnPost? originalPost, - List<_i30.PageRouteInfo>? children, + _i32.Key? key, + _i34.SnPost? originalPost, + List<_i31.PageRouteInfo>? children, }) : super( ArticleComposeRoute.name, args: ArticleComposeRouteArgs(key: key, originalPost: originalPost), @@ -191,13 +208,13 @@ class ArticleComposeRoute extends _i30.PageRouteInfo { static const String name = 'ArticleComposeRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const ArticleComposeRouteArgs(), ); - return _i4.ArticleComposeScreen( + return _i5.ArticleComposeScreen( key: args.key, originalPost: args.originalPost, ); @@ -208,9 +225,9 @@ class ArticleComposeRoute extends _i30.PageRouteInfo { class ArticleComposeRouteArgs { const ArticleComposeRouteArgs({this.key, this.originalPost}); - final _i31.Key? key; + final _i32.Key? key; - final _i33.SnPost? originalPost; + final _i34.SnPost? originalPost; @override String toString() { @@ -229,12 +246,12 @@ class ArticleComposeRouteArgs { } /// generated route for -/// [_i4.ArticleEditScreen] -class ArticleEditRoute extends _i30.PageRouteInfo { +/// [_i5.ArticleEditScreen] +class ArticleEditRoute extends _i31.PageRouteInfo { ArticleEditRoute({ - _i31.Key? key, + _i32.Key? key, required String id, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( ArticleEditRoute.name, args: ArticleEditRouteArgs(key: key, id: id), @@ -244,14 +261,14 @@ class ArticleEditRoute extends _i30.PageRouteInfo { static const String name = 'ArticleEditRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => ArticleEditRouteArgs(id: pathParams.getString('id')), ); - return _i4.ArticleEditScreen(key: args.key, id: args.id); + return _i5.ArticleEditScreen(key: args.key, id: args.id); }, ); } @@ -259,7 +276,7 @@ class ArticleEditRoute extends _i30.PageRouteInfo { class ArticleEditRouteArgs { const ArticleEditRouteArgs({this.key, required this.id}); - final _i31.Key? key; + final _i32.Key? key; final String id; @@ -280,12 +297,12 @@ class ArticleEditRouteArgs { } /// generated route for -/// [_i5.CallScreen] -class CallRoute extends _i30.PageRouteInfo { +/// [_i6.CallScreen] +class CallRoute extends _i31.PageRouteInfo { CallRoute({ - _i31.Key? key, + _i32.Key? key, required String roomId, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( CallRoute.name, args: CallRouteArgs(key: key, roomId: roomId), @@ -295,14 +312,14 @@ class CallRoute extends _i30.PageRouteInfo { static const String name = 'CallRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => CallRouteArgs(roomId: pathParams.getString('id')), ); - return _i5.CallScreen(key: args.key, roomId: args.roomId); + return _i6.CallScreen(key: args.key, roomId: args.roomId); }, ); } @@ -310,7 +327,7 @@ class CallRoute extends _i30.PageRouteInfo { class CallRouteArgs { const CallRouteArgs({this.key, required this.roomId}); - final _i31.Key? key; + final _i32.Key? key; final String roomId; @@ -331,12 +348,12 @@ class CallRouteArgs { } /// generated route for -/// [_i6.ChatDetailScreen] -class ChatDetailRoute extends _i30.PageRouteInfo { +/// [_i7.ChatDetailScreen] +class ChatDetailRoute extends _i31.PageRouteInfo { ChatDetailRoute({ - _i31.Key? key, + _i32.Key? key, required String id, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( ChatDetailRoute.name, args: ChatDetailRouteArgs(key: key, id: id), @@ -346,14 +363,14 @@ class ChatDetailRoute extends _i30.PageRouteInfo { static const String name = 'ChatDetailRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => ChatDetailRouteArgs(id: pathParams.getString('id')), ); - return _i6.ChatDetailScreen(key: args.key, id: args.id); + return _i7.ChatDetailScreen(key: args.key, id: args.id); }, ); } @@ -361,7 +378,7 @@ class ChatDetailRoute extends _i30.PageRouteInfo { class ChatDetailRouteArgs { const ChatDetailRouteArgs({this.key, required this.id}); - final _i31.Key? key; + final _i32.Key? key; final String id; @@ -382,12 +399,12 @@ class ChatDetailRouteArgs { } /// generated route for -/// [_i7.ChatListScreen] -class ChatListRoute extends _i30.PageRouteInfo { +/// [_i8.ChatListScreen] +class ChatListRoute extends _i31.PageRouteInfo { ChatListRoute({ - _i31.Key? key, + _i32.Key? key, bool isAside = false, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( ChatListRoute.name, args: ChatListRouteArgs(key: key, isAside: isAside), @@ -396,13 +413,13 @@ class ChatListRoute extends _i30.PageRouteInfo { static const String name = 'ChatListRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const ChatListRouteArgs(), ); - return _i7.ChatListScreen(key: args.key, isAside: args.isAside); + return _i8.ChatListScreen(key: args.key, isAside: args.isAside); }, ); } @@ -410,7 +427,7 @@ class ChatListRoute extends _i30.PageRouteInfo { class ChatListRouteArgs { const ChatListRouteArgs({this.key, this.isAside = false}); - final _i31.Key? key; + final _i32.Key? key; final bool isAside; @@ -431,12 +448,12 @@ class ChatListRouteArgs { } /// generated route for -/// [_i8.ChatRoomScreen] -class ChatRoomRoute extends _i30.PageRouteInfo { +/// [_i9.ChatRoomScreen] +class ChatRoomRoute extends _i31.PageRouteInfo { ChatRoomRoute({ - _i32.Key? key, + _i33.Key? key, required String id, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( ChatRoomRoute.name, args: ChatRoomRouteArgs(key: key, id: id), @@ -446,14 +463,14 @@ class ChatRoomRoute extends _i30.PageRouteInfo { static const String name = 'ChatRoomRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => ChatRoomRouteArgs(id: pathParams.getString('id')), ); - return _i8.ChatRoomScreen(key: args.key, id: args.id); + return _i9.ChatRoomScreen(key: args.key, id: args.id); }, ); } @@ -461,7 +478,7 @@ class ChatRoomRoute extends _i30.PageRouteInfo { class ChatRoomRouteArgs { const ChatRoomRouteArgs({this.key, required this.id}); - final _i32.Key? key; + final _i33.Key? key; final String id; @@ -482,44 +499,44 @@ class ChatRoomRouteArgs { } /// generated route for -/// [_i7.ChatShellScreen] -class ChatShellRoute extends _i30.PageRouteInfo { - const ChatShellRoute({List<_i30.PageRouteInfo>? children}) +/// [_i8.ChatShellScreen] +class ChatShellRoute extends _i31.PageRouteInfo { + const ChatShellRoute({List<_i31.PageRouteInfo>? children}) : super(ChatShellRoute.name, initialChildren: children); static const String name = 'ChatShellRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i7.ChatShellScreen(); + return const _i8.ChatShellScreen(); }, ); } /// generated route for -/// [_i9.CreateAccountScreen] -class CreateAccountRoute extends _i30.PageRouteInfo { - const CreateAccountRoute({List<_i30.PageRouteInfo>? children}) +/// [_i10.CreateAccountScreen] +class CreateAccountRoute extends _i31.PageRouteInfo { + const CreateAccountRoute({List<_i31.PageRouteInfo>? children}) : super(CreateAccountRoute.name, initialChildren: children); static const String name = 'CreateAccountRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i9.CreateAccountScreen(); + return const _i10.CreateAccountScreen(); }, ); } /// generated route for -/// [_i10.CreatorHubScreen] -class CreatorHubRoute extends _i30.PageRouteInfo { +/// [_i11.CreatorHubScreen] +class CreatorHubRoute extends _i31.PageRouteInfo { CreatorHubRoute({ - _i31.Key? key, + _i32.Key? key, bool isAside = false, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( CreatorHubRoute.name, args: CreatorHubRouteArgs(key: key, isAside: isAside), @@ -528,13 +545,13 @@ class CreatorHubRoute extends _i30.PageRouteInfo { static const String name = 'CreatorHubRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const CreatorHubRouteArgs(), ); - return _i10.CreatorHubScreen(key: args.key, isAside: args.isAside); + return _i11.CreatorHubScreen(key: args.key, isAside: args.isAside); }, ); } @@ -542,7 +559,7 @@ class CreatorHubRoute extends _i30.PageRouteInfo { class CreatorHubRouteArgs { const CreatorHubRouteArgs({this.key, this.isAside = false}); - final _i31.Key? key; + final _i32.Key? key; final bool isAside; @@ -563,29 +580,29 @@ class CreatorHubRouteArgs { } /// generated route for -/// [_i10.CreatorHubShellScreen] -class CreatorHubShellRoute extends _i30.PageRouteInfo { - const CreatorHubShellRoute({List<_i30.PageRouteInfo>? children}) +/// [_i11.CreatorHubShellScreen] +class CreatorHubShellRoute extends _i31.PageRouteInfo { + const CreatorHubShellRoute({List<_i31.PageRouteInfo>? children}) : super(CreatorHubShellRoute.name, initialChildren: children); static const String name = 'CreatorHubShellRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i10.CreatorHubShellScreen(); + return const _i11.CreatorHubShellScreen(); }, ); } /// generated route for -/// [_i11.CreatorPostListScreen] +/// [_i12.CreatorPostListScreen] class CreatorPostListRoute - extends _i30.PageRouteInfo { + extends _i31.PageRouteInfo { CreatorPostListRoute({ - _i31.Key? key, + _i32.Key? key, required String pubName, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( CreatorPostListRoute.name, args: CreatorPostListRouteArgs(key: key, pubName: pubName), @@ -595,7 +612,7 @@ class CreatorPostListRoute static const String name = 'CreatorPostListRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -604,7 +621,7 @@ class CreatorPostListRoute () => CreatorPostListRouteArgs(pubName: pathParams.getString('name')), ); - return _i11.CreatorPostListScreen(key: args.key, pubName: args.pubName); + return _i12.CreatorPostListScreen(key: args.key, pubName: args.pubName); }, ); } @@ -612,7 +629,7 @@ class CreatorPostListRoute class CreatorPostListRouteArgs { const CreatorPostListRouteArgs({this.key, required this.pubName}); - final _i31.Key? key; + final _i32.Key? key; final String pubName; @@ -633,9 +650,9 @@ class CreatorPostListRouteArgs { } /// generated route for -/// [_i7.EditChatScreen] -class EditChatRoute extends _i30.PageRouteInfo { - EditChatRoute({_i31.Key? key, String? id, List<_i30.PageRouteInfo>? children}) +/// [_i8.EditChatScreen] +class EditChatRoute extends _i31.PageRouteInfo { + EditChatRoute({_i32.Key? key, String? id, List<_i31.PageRouteInfo>? children}) : super( EditChatRoute.name, args: EditChatRouteArgs(key: key, id: id), @@ -645,14 +662,14 @@ class EditChatRoute extends _i30.PageRouteInfo { static const String name = 'EditChatRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => EditChatRouteArgs(id: pathParams.optString('id')), ); - return _i7.EditChatScreen(key: args.key, id: args.id); + return _i8.EditChatScreen(key: args.key, id: args.id); }, ); } @@ -660,7 +677,7 @@ class EditChatRoute extends _i30.PageRouteInfo { class EditChatRouteArgs { const EditChatRouteArgs({this.key, this.id}); - final _i31.Key? key; + final _i32.Key? key; final String? id; @@ -681,12 +698,12 @@ class EditChatRouteArgs { } /// generated route for -/// [_i12.EditPublisherScreen] -class EditPublisherRoute extends _i30.PageRouteInfo { +/// [_i13.EditPublisherScreen] +class EditPublisherRoute extends _i31.PageRouteInfo { EditPublisherRoute({ - _i31.Key? key, + _i32.Key? key, String? name, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( EditPublisherRoute.name, args: EditPublisherRouteArgs(key: key, name: name), @@ -696,14 +713,14 @@ class EditPublisherRoute extends _i30.PageRouteInfo { static const String name = 'EditPublisherRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => EditPublisherRouteArgs(name: pathParams.optString('id')), ); - return _i12.EditPublisherScreen(key: args.key, name: args.name); + return _i13.EditPublisherScreen(key: args.key, name: args.name); }, ); } @@ -711,7 +728,7 @@ class EditPublisherRoute extends _i30.PageRouteInfo { class EditPublisherRouteArgs { const EditPublisherRouteArgs({this.key, this.name}); - final _i31.Key? key; + final _i32.Key? key; final String? name; @@ -732,12 +749,12 @@ class EditPublisherRouteArgs { } /// generated route for -/// [_i13.EditRealmScreen] -class EditRealmRoute extends _i30.PageRouteInfo { +/// [_i14.EditRealmScreen] +class EditRealmRoute extends _i31.PageRouteInfo { EditRealmRoute({ - _i31.Key? key, + _i32.Key? key, String? slug, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( EditRealmRoute.name, args: EditRealmRouteArgs(key: key, slug: slug), @@ -747,14 +764,14 @@ class EditRealmRoute extends _i30.PageRouteInfo { static const String name = 'EditRealmRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => EditRealmRouteArgs(slug: pathParams.optString('slug')), ); - return _i13.EditRealmScreen(key: args.key, slug: args.slug); + return _i14.EditRealmScreen(key: args.key, slug: args.slug); }, ); } @@ -762,7 +779,7 @@ class EditRealmRoute extends _i30.PageRouteInfo { class EditRealmRouteArgs { const EditRealmRouteArgs({this.key, this.slug}); - final _i31.Key? key; + final _i32.Key? key; final String? slug; @@ -783,14 +800,14 @@ class EditRealmRouteArgs { } /// generated route for -/// [_i14.EditStickerPacksScreen] +/// [_i15.EditStickerPacksScreen] class EditStickerPacksRoute - extends _i30.PageRouteInfo { + extends _i31.PageRouteInfo { EditStickerPacksRoute({ - _i31.Key? key, + _i32.Key? key, required String pubName, String? packId, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( EditStickerPacksRoute.name, args: EditStickerPacksRouteArgs( @@ -804,7 +821,7 @@ class EditStickerPacksRoute static const String name = 'EditStickerPacksRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -815,7 +832,7 @@ class EditStickerPacksRoute packId: pathParams.optString('packId'), ), ); - return _i14.EditStickerPacksScreen( + return _i15.EditStickerPacksScreen( key: args.key, pubName: args.pubName, packId: args.packId, @@ -831,7 +848,7 @@ class EditStickerPacksRouteArgs { this.packId, }); - final _i31.Key? key; + final _i32.Key? key; final String pubName; @@ -856,13 +873,13 @@ class EditStickerPacksRouteArgs { } /// generated route for -/// [_i15.EditStickersScreen] -class EditStickersRoute extends _i30.PageRouteInfo { +/// [_i16.EditStickersScreen] +class EditStickersRoute extends _i31.PageRouteInfo { EditStickersRoute({ - _i31.Key? key, + _i32.Key? key, required String packId, required String? id, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( EditStickersRoute.name, args: EditStickersRouteArgs(key: key, packId: packId, id: id), @@ -872,7 +889,7 @@ class EditStickersRoute extends _i30.PageRouteInfo { static const String name = 'EditStickersRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -883,7 +900,7 @@ class EditStickersRoute extends _i30.PageRouteInfo { id: pathParams.optString('id'), ), ); - return _i15.EditStickersScreen( + return _i16.EditStickersScreen( key: args.key, packId: args.packId, id: args.id, @@ -899,7 +916,7 @@ class EditStickersRouteArgs { required this.id, }); - final _i31.Key? key; + final _i32.Key? key; final String packId; @@ -922,12 +939,12 @@ class EditStickersRouteArgs { } /// generated route for -/// [_i16.EventCalanderScreen] -class EventCalanderRoute extends _i30.PageRouteInfo { +/// [_i17.EventCalanderScreen] +class EventCalanderRoute extends _i31.PageRouteInfo { EventCalanderRoute({ - _i31.Key? key, + _i32.Key? key, required String name, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( EventCalanderRoute.name, args: EventCalanderRouteArgs(key: key, name: name), @@ -937,7 +954,7 @@ class EventCalanderRoute extends _i30.PageRouteInfo { static const String name = 'EventCalanderRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -945,7 +962,7 @@ class EventCalanderRoute extends _i30.PageRouteInfo { orElse: () => EventCalanderRouteArgs(name: pathParams.getString('name')), ); - return _i16.EventCalanderScreen(key: args.key, name: args.name); + return _i17.EventCalanderScreen(key: args.key, name: args.name); }, ); } @@ -953,7 +970,7 @@ class EventCalanderRoute extends _i30.PageRouteInfo { class EventCalanderRouteArgs { const EventCalanderRouteArgs({this.key, required this.name}); - final _i31.Key? key; + final _i32.Key? key; final String name; @@ -974,12 +991,12 @@ class EventCalanderRouteArgs { } /// generated route for -/// [_i17.ExploreScreen] -class ExploreRoute extends _i30.PageRouteInfo { +/// [_i18.ExploreScreen] +class ExploreRoute extends _i31.PageRouteInfo { ExploreRoute({ - _i31.Key? key, + _i32.Key? key, bool isAside = false, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( ExploreRoute.name, args: ExploreRouteArgs(key: key, isAside: isAside), @@ -988,13 +1005,13 @@ class ExploreRoute extends _i30.PageRouteInfo { static const String name = 'ExploreRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const ExploreRouteArgs(), ); - return _i17.ExploreScreen(key: args.key, isAside: args.isAside); + return _i18.ExploreScreen(key: args.key, isAside: args.isAside); }, ); } @@ -1002,7 +1019,7 @@ class ExploreRoute extends _i30.PageRouteInfo { class ExploreRouteArgs { const ExploreRouteArgs({this.key, this.isAside = false}); - final _i31.Key? key; + final _i32.Key? key; final bool isAside; @@ -1023,109 +1040,109 @@ class ExploreRouteArgs { } /// generated route for -/// [_i17.ExploreShellScreen] -class ExploreShellRoute extends _i30.PageRouteInfo { - const ExploreShellRoute({List<_i30.PageRouteInfo>? children}) +/// [_i18.ExploreShellScreen] +class ExploreShellRoute extends _i31.PageRouteInfo { + const ExploreShellRoute({List<_i31.PageRouteInfo>? children}) : super(ExploreShellRoute.name, initialChildren: children); static const String name = 'ExploreShellRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i17.ExploreShellScreen(); + return const _i18.ExploreShellScreen(); }, ); } /// generated route for -/// [_i18.LevelingScreen] -class LevelingRoute extends _i30.PageRouteInfo { - const LevelingRoute({List<_i30.PageRouteInfo>? children}) +/// [_i19.LevelingScreen] +class LevelingRoute extends _i31.PageRouteInfo { + const LevelingRoute({List<_i31.PageRouteInfo>? children}) : super(LevelingRoute.name, initialChildren: children); static const String name = 'LevelingRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i18.LevelingScreen(); + return const _i19.LevelingScreen(); }, ); } /// generated route for -/// [_i19.LoginScreen] -class LoginRoute extends _i30.PageRouteInfo { - const LoginRoute({List<_i30.PageRouteInfo>? children}) +/// [_i20.LoginScreen] +class LoginRoute extends _i31.PageRouteInfo { + const LoginRoute({List<_i31.PageRouteInfo>? children}) : super(LoginRoute.name, initialChildren: children); static const String name = 'LoginRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i19.LoginScreen(); + return const _i20.LoginScreen(); }, ); } /// generated route for -/// [_i7.NewChatScreen] -class NewChatRoute extends _i30.PageRouteInfo { - const NewChatRoute({List<_i30.PageRouteInfo>? children}) +/// [_i8.NewChatScreen] +class NewChatRoute extends _i31.PageRouteInfo { + const NewChatRoute({List<_i31.PageRouteInfo>? children}) : super(NewChatRoute.name, initialChildren: children); static const String name = 'NewChatRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i7.NewChatScreen(); + return const _i8.NewChatScreen(); }, ); } /// generated route for -/// [_i12.NewPublisherScreen] -class NewPublisherRoute extends _i30.PageRouteInfo { - const NewPublisherRoute({List<_i30.PageRouteInfo>? children}) +/// [_i13.NewPublisherScreen] +class NewPublisherRoute extends _i31.PageRouteInfo { + const NewPublisherRoute({List<_i31.PageRouteInfo>? children}) : super(NewPublisherRoute.name, initialChildren: children); static const String name = 'NewPublisherRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i12.NewPublisherScreen(); + return const _i13.NewPublisherScreen(); }, ); } /// generated route for -/// [_i13.NewRealmScreen] -class NewRealmRoute extends _i30.PageRouteInfo { - const NewRealmRoute({List<_i30.PageRouteInfo>? children}) +/// [_i14.NewRealmScreen] +class NewRealmRoute extends _i31.PageRouteInfo { + const NewRealmRoute({List<_i31.PageRouteInfo>? children}) : super(NewRealmRoute.name, initialChildren: children); static const String name = 'NewRealmRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i13.NewRealmScreen(); + return const _i14.NewRealmScreen(); }, ); } /// generated route for -/// [_i14.NewStickerPacksScreen] +/// [_i15.NewStickerPacksScreen] class NewStickerPacksRoute - extends _i30.PageRouteInfo { + extends _i31.PageRouteInfo { NewStickerPacksRoute({ - _i31.Key? key, + _i32.Key? key, required String pubName, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( NewStickerPacksRoute.name, args: NewStickerPacksRouteArgs(key: key, pubName: pubName), @@ -1135,7 +1152,7 @@ class NewStickerPacksRoute static const String name = 'NewStickerPacksRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1144,7 +1161,7 @@ class NewStickerPacksRoute () => NewStickerPacksRouteArgs(pubName: pathParams.getString('name')), ); - return _i14.NewStickerPacksScreen(key: args.key, pubName: args.pubName); + return _i15.NewStickerPacksScreen(key: args.key, pubName: args.pubName); }, ); } @@ -1152,7 +1169,7 @@ class NewStickerPacksRoute class NewStickerPacksRouteArgs { const NewStickerPacksRouteArgs({this.key, required this.pubName}); - final _i31.Key? key; + final _i32.Key? key; final String pubName; @@ -1173,12 +1190,12 @@ class NewStickerPacksRouteArgs { } /// generated route for -/// [_i15.NewStickersScreen] -class NewStickersRoute extends _i30.PageRouteInfo { +/// [_i16.NewStickersScreen] +class NewStickersRoute extends _i31.PageRouteInfo { NewStickersRoute({ - _i31.Key? key, + _i32.Key? key, required String packId, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( NewStickersRoute.name, args: NewStickersRouteArgs(key: key, packId: packId), @@ -1188,7 +1205,7 @@ class NewStickersRoute extends _i30.PageRouteInfo { static const String name = 'NewStickersRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1196,7 +1213,7 @@ class NewStickersRoute extends _i30.PageRouteInfo { orElse: () => NewStickersRouteArgs(packId: pathParams.getString('packId')), ); - return _i15.NewStickersScreen(key: args.key, packId: args.packId); + return _i16.NewStickersScreen(key: args.key, packId: args.packId); }, ); } @@ -1204,7 +1221,7 @@ class NewStickersRoute extends _i30.PageRouteInfo { class NewStickersRouteArgs { const NewStickersRouteArgs({this.key, required this.packId}); - final _i31.Key? key; + final _i32.Key? key; final String packId; @@ -1225,31 +1242,31 @@ class NewStickersRouteArgs { } /// generated route for -/// [_i20.NotificationScreen] -class NotificationRoute extends _i30.PageRouteInfo { - const NotificationRoute({List<_i30.PageRouteInfo>? children}) +/// [_i21.NotificationScreen] +class NotificationRoute extends _i31.PageRouteInfo { + const NotificationRoute({List<_i31.PageRouteInfo>? children}) : super(NotificationRoute.name, initialChildren: children); static const String name = 'NotificationRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i20.NotificationScreen(); + return const _i21.NotificationScreen(); }, ); } /// generated route for -/// [_i21.PostComposeScreen] -class PostComposeRoute extends _i30.PageRouteInfo { +/// [_i22.PostComposeScreen] +class PostComposeRoute extends _i31.PageRouteInfo { PostComposeRoute({ - _i31.Key? key, - _i33.SnPost? originalPost, - _i33.SnPost? repliedPost, - _i33.SnPost? forwardedPost, + _i32.Key? key, + _i34.SnPost? originalPost, + _i34.SnPost? repliedPost, + _i34.SnPost? forwardedPost, int? type, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( PostComposeRoute.name, args: PostComposeRouteArgs( @@ -1265,14 +1282,14 @@ class PostComposeRoute extends _i30.PageRouteInfo { static const String name = 'PostComposeRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final queryParams = data.queryParams; final args = data.argsAs( orElse: () => PostComposeRouteArgs(type: queryParams.optInt('type')), ); - return _i21.PostComposeScreen( + return _i22.PostComposeScreen( key: args.key, originalPost: args.originalPost, repliedPost: args.repliedPost, @@ -1292,13 +1309,13 @@ class PostComposeRouteArgs { this.type, }); - final _i31.Key? key; + final _i32.Key? key; - final _i33.SnPost? originalPost; + final _i34.SnPost? originalPost; - final _i33.SnPost? repliedPost; + final _i34.SnPost? repliedPost; - final _i33.SnPost? forwardedPost; + final _i34.SnPost? forwardedPost; final int? type; @@ -1328,12 +1345,12 @@ class PostComposeRouteArgs { } /// generated route for -/// [_i22.PostDetailScreen] -class PostDetailRoute extends _i30.PageRouteInfo { +/// [_i23.PostDetailScreen] +class PostDetailRoute extends _i31.PageRouteInfo { PostDetailRoute({ - _i31.Key? key, + _i32.Key? key, required String id, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( PostDetailRoute.name, args: PostDetailRouteArgs(key: key, id: id), @@ -1343,14 +1360,14 @@ class PostDetailRoute extends _i30.PageRouteInfo { static const String name = 'PostDetailRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => PostDetailRouteArgs(id: pathParams.getString('id')), ); - return _i22.PostDetailScreen(key: args.key, id: args.id); + return _i23.PostDetailScreen(key: args.key, id: args.id); }, ); } @@ -1358,7 +1375,7 @@ class PostDetailRoute extends _i30.PageRouteInfo { class PostDetailRouteArgs { const PostDetailRouteArgs({this.key, required this.id}); - final _i31.Key? key; + final _i32.Key? key; final String id; @@ -1379,12 +1396,12 @@ class PostDetailRouteArgs { } /// generated route for -/// [_i21.PostEditScreen] -class PostEditRoute extends _i30.PageRouteInfo { +/// [_i22.PostEditScreen] +class PostEditRoute extends _i31.PageRouteInfo { PostEditRoute({ - _i31.Key? key, + _i32.Key? key, required String id, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( PostEditRoute.name, args: PostEditRouteArgs(key: key, id: id), @@ -1394,14 +1411,14 @@ class PostEditRoute extends _i30.PageRouteInfo { static const String name = 'PostEditRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => PostEditRouteArgs(id: pathParams.getString('id')), ); - return _i21.PostEditScreen(key: args.key, id: args.id); + return _i22.PostEditScreen(key: args.key, id: args.id); }, ); } @@ -1409,7 +1426,7 @@ class PostEditRoute extends _i30.PageRouteInfo { class PostEditRouteArgs { const PostEditRouteArgs({this.key, required this.id}); - final _i31.Key? key; + final _i32.Key? key; final String id; @@ -1430,13 +1447,13 @@ class PostEditRouteArgs { } /// generated route for -/// [_i23.PublisherProfileScreen] +/// [_i24.PublisherProfileScreen] class PublisherProfileRoute - extends _i30.PageRouteInfo { + extends _i31.PageRouteInfo { PublisherProfileRoute({ - _i31.Key? key, + _i32.Key? key, required String name, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( PublisherProfileRoute.name, args: PublisherProfileRouteArgs(key: key, name: name), @@ -1446,7 +1463,7 @@ class PublisherProfileRoute static const String name = 'PublisherProfileRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1454,7 +1471,7 @@ class PublisherProfileRoute orElse: () => PublisherProfileRouteArgs(name: pathParams.getString('name')), ); - return _i23.PublisherProfileScreen(key: args.key, name: args.name); + return _i24.PublisherProfileScreen(key: args.key, name: args.name); }, ); } @@ -1462,7 +1479,7 @@ class PublisherProfileRoute class PublisherProfileRouteArgs { const PublisherProfileRouteArgs({this.key, required this.name}); - final _i31.Key? key; + final _i32.Key? key; final String name; @@ -1483,12 +1500,12 @@ class PublisherProfileRouteArgs { } /// generated route for -/// [_i24.RealmDetailScreen] -class RealmDetailRoute extends _i30.PageRouteInfo { +/// [_i25.RealmDetailScreen] +class RealmDetailRoute extends _i31.PageRouteInfo { RealmDetailRoute({ - _i31.Key? key, + _i32.Key? key, required String slug, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( RealmDetailRoute.name, args: RealmDetailRouteArgs(key: key, slug: slug), @@ -1498,14 +1515,14 @@ class RealmDetailRoute extends _i30.PageRouteInfo { static const String name = 'RealmDetailRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => RealmDetailRouteArgs(slug: pathParams.getString('slug')), ); - return _i24.RealmDetailScreen(key: args.key, slug: args.slug); + return _i25.RealmDetailScreen(key: args.key, slug: args.slug); }, ); } @@ -1513,7 +1530,7 @@ class RealmDetailRoute extends _i30.PageRouteInfo { class RealmDetailRouteArgs { const RealmDetailRouteArgs({this.key, required this.slug}); - final _i31.Key? key; + final _i32.Key? key; final String slug; @@ -1534,62 +1551,62 @@ class RealmDetailRouteArgs { } /// generated route for -/// [_i13.RealmListScreen] -class RealmListRoute extends _i30.PageRouteInfo { - const RealmListRoute({List<_i30.PageRouteInfo>? children}) +/// [_i14.RealmListScreen] +class RealmListRoute extends _i31.PageRouteInfo { + const RealmListRoute({List<_i31.PageRouteInfo>? children}) : super(RealmListRoute.name, initialChildren: children); static const String name = 'RealmListRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i13.RealmListScreen(); + return const _i14.RealmListScreen(); }, ); } /// generated route for -/// [_i25.RelationshipScreen] -class RelationshipRoute extends _i30.PageRouteInfo { - const RelationshipRoute({List<_i30.PageRouteInfo>? children}) +/// [_i26.RelationshipScreen] +class RelationshipRoute extends _i31.PageRouteInfo { + const RelationshipRoute({List<_i31.PageRouteInfo>? children}) : super(RelationshipRoute.name, initialChildren: children); static const String name = 'RelationshipRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i25.RelationshipScreen(); + return const _i26.RelationshipScreen(); }, ); } /// generated route for -/// [_i26.SettingsScreen] -class SettingsRoute extends _i30.PageRouteInfo { - const SettingsRoute({List<_i30.PageRouteInfo>? children}) +/// [_i27.SettingsScreen] +class SettingsRoute extends _i31.PageRouteInfo { + const SettingsRoute({List<_i31.PageRouteInfo>? children}) : super(SettingsRoute.name, initialChildren: children); static const String name = 'SettingsRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i26.SettingsScreen(); + return const _i27.SettingsScreen(); }, ); } /// generated route for -/// [_i15.StickerPackDetailScreen] +/// [_i16.StickerPackDetailScreen] class StickerPackDetailRoute - extends _i30.PageRouteInfo { + extends _i31.PageRouteInfo { StickerPackDetailRoute({ - _i31.Key? key, + _i32.Key? key, required String pubName, required String id, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( StickerPackDetailRoute.name, args: StickerPackDetailRouteArgs(key: key, pubName: pubName, id: id), @@ -1599,7 +1616,7 @@ class StickerPackDetailRoute static const String name = 'StickerPackDetailRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; @@ -1610,7 +1627,7 @@ class StickerPackDetailRoute id: pathParams.getString('packId'), ), ); - return _i15.StickerPackDetailScreen( + return _i16.StickerPackDetailScreen( key: args.key, pubName: args.pubName, id: args.id, @@ -1626,7 +1643,7 @@ class StickerPackDetailRouteArgs { required this.id, }); - final _i31.Key? key; + final _i32.Key? key; final String pubName; @@ -1649,12 +1666,12 @@ class StickerPackDetailRouteArgs { } /// generated route for -/// [_i14.StickersScreen] -class StickersRoute extends _i30.PageRouteInfo { +/// [_i15.StickersScreen] +class StickersRoute extends _i31.PageRouteInfo { StickersRoute({ - _i31.Key? key, + _i32.Key? key, required String pubName, - List<_i30.PageRouteInfo>? children, + List<_i31.PageRouteInfo>? children, }) : super( StickersRoute.name, args: StickersRouteArgs(key: key, pubName: pubName), @@ -1664,14 +1681,14 @@ class StickersRoute extends _i30.PageRouteInfo { static const String name = 'StickersRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( orElse: () => StickersRouteArgs(pubName: pathParams.getString('name')), ); - return _i14.StickersScreen(key: args.key, pubName: args.pubName); + return _i15.StickersScreen(key: args.key, pubName: args.pubName); }, ); } @@ -1679,7 +1696,7 @@ class StickersRoute extends _i30.PageRouteInfo { class StickersRouteArgs { const StickersRouteArgs({this.key, required this.pubName}); - final _i31.Key? key; + final _i32.Key? key; final String pubName; @@ -1700,49 +1717,49 @@ class StickersRouteArgs { } /// generated route for -/// [_i27.TabsScreen] -class TabsRoute extends _i30.PageRouteInfo { - const TabsRoute({List<_i30.PageRouteInfo>? children}) +/// [_i28.TabsScreen] +class TabsRoute extends _i31.PageRouteInfo { + const TabsRoute({List<_i31.PageRouteInfo>? children}) : super(TabsRoute.name, initialChildren: children); static const String name = 'TabsRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i27.TabsScreen(); + return const _i28.TabsScreen(); }, ); } /// generated route for -/// [_i28.UpdateProfileScreen] -class UpdateProfileRoute extends _i30.PageRouteInfo { - const UpdateProfileRoute({List<_i30.PageRouteInfo>? children}) +/// [_i29.UpdateProfileScreen] +class UpdateProfileRoute extends _i31.PageRouteInfo { + const UpdateProfileRoute({List<_i31.PageRouteInfo>? children}) : super(UpdateProfileRoute.name, initialChildren: children); static const String name = 'UpdateProfileRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i28.UpdateProfileScreen(); + return const _i29.UpdateProfileScreen(); }, ); } /// generated route for -/// [_i29.WalletScreen] -class WalletRoute extends _i30.PageRouteInfo { - const WalletRoute({List<_i30.PageRouteInfo>? children}) +/// [_i30.WalletScreen] +class WalletRoute extends _i31.PageRouteInfo { + const WalletRoute({List<_i31.PageRouteInfo>? children}) : super(WalletRoute.name, initialChildren: children); static const String name = 'WalletRoute'; - static _i30.PageInfo page = _i30.PageInfo( + static _i31.PageInfo page = _i31.PageInfo( name, builder: (data) { - return const _i29.WalletScreen(); + return const _i30.WalletScreen(); }, ); } diff --git a/lib/services/compose_storage_db.g.dart b/lib/services/compose_storage_db.g.dart index 051438a..06dd9c5 100644 --- a/lib/services/compose_storage_db.g.dart +++ b/lib/services/compose_storage_db.g.dart @@ -7,7 +7,7 @@ part of 'compose_storage_db.dart'; // ************************************************************************** String _$composeStorageNotifierHash() => - r'3de7a01a93d999d45a32fb68617b77f194589686'; + r'4ab4dce85d0a961f096dc3b11505f8f0964dee9d'; /// See also [ComposeStorageNotifier]. @ProviderFor(ComposeStorageNotifier) diff --git a/lib/services/sharing_intent.dart b/lib/services/sharing_intent.dart new file mode 100644 index 0000000..e1cb0ce --- /dev/null +++ b/lib/services/sharing_intent.dart @@ -0,0 +1,91 @@ +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:receive_sharing_intent/receive_sharing_intent.dart'; +import 'package:island/widgets/share/share_sheet.dart'; +import 'package:share_plus/share_plus.dart'; +import 'package:easy_localization/easy_localization.dart'; + +class SharingIntentService { + static final SharingIntentService _instance = + SharingIntentService._internal(); + factory SharingIntentService() => _instance; + SharingIntentService._internal(); + + StreamSubscription>? _intentSub; + BuildContext? _context; + + /// Initialize the sharing intent service + void initialize(BuildContext context) { + debugPrint("SharingIntentService: Initializing with context"); + _context = context; + _setupSharingListeners(); + } + + /// Setup listeners for sharing intents + void _setupSharingListeners() { + debugPrint("SharingIntentService: Setting up sharing listeners"); + + // Listen to media sharing coming from outside the app while the app is in memory + _intentSub = ReceiveSharingIntent.instance.getMediaStream().listen( + (List value) { + debugPrint( + "SharingIntentService: Media stream received ${value.length} files", + ); + if (value.isNotEmpty) { + _handleSharedContent(value); + } + }, + onError: (err) { + debugPrint("SharingIntentService: Stream error: $err"); + }, + ); + + // Get the media sharing coming from outside the app while the app is closed + ReceiveSharingIntent.instance.getInitialMedia().then(( + List value, + ) { + debugPrint( + "SharingIntentService: Initial media received ${value.length} files", + ); + if (value.isNotEmpty) { + _handleSharedContent(value); + // Tell the library that we are done processing the intent + ReceiveSharingIntent.instance.reset(); + } + }); + } + + /// Handle shared media files + void _handleSharedContent(List sharedFiles) { + if (_context == null) { + debugPrint( + "SharingIntentService: Context is null, cannot handle shared content", + ); + return; + } + + debugPrint( + "SharingIntentService: Received ${sharedFiles.length} shared files", + ); + for (final file in sharedFiles) { + debugPrint( + "SharingIntentService: File path: ${file.path}, type: ${file.type}", + ); + } + + // Convert SharedMediaFile to XFile + final List files = + sharedFiles + .map((file) => XFile(file.path, name: file.path.split('/').last)) + .toList(); + + // Show ShareSheet with the shared files + showShareSheet(context: _context!, content: ShareContent.files(files)); + } + + /// Dispose of resources + void dispose() { + _intentSub?.cancel(); + _context = null; + } +} diff --git a/lib/widgets/app_wrapper.dart b/lib/widgets/app_wrapper.dart new file mode 100644 index 0000000..dee4407 --- /dev/null +++ b/lib/widgets/app_wrapper.dart @@ -0,0 +1,23 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; +import 'package:hooks_riverpod/hooks_riverpod.dart'; +import 'package:island/services/sharing_intent.dart'; + +@RoutePage() +class AppWrapper extends HookConsumerWidget { + const AppWrapper({super.key}); + + @override + Widget build(BuildContext context, WidgetRef ref) { + useEffect(() { + final sharingService = SharingIntentService(); + sharingService.initialize(context); + return () { + sharingService.dispose(); + }; + }, const []); + + return AutoRouter(); + } +}