fix: Open deep link on android
This commit is contained in:
parent
ff3e032638
commit
383d708500
3 changed files with 6 additions and 8 deletions
|
|
@ -172,8 +172,8 @@ abstract class AppRoutes {
|
||||||
context,
|
context,
|
||||||
state,
|
state,
|
||||||
NewPrivateChat(
|
NewPrivateChat(
|
||||||
key: ValueKey('new_chat_${state.uri.query}'),
|
key: ValueKey('new_chat_${state.uri.fragment}'),
|
||||||
deeplink: state.uri.queryParameters['deeplink'],
|
deeplink: state.uri.fragment,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
redirect: loggedOutRedirect,
|
redirect: loggedOutRedirect,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
|
||||||
|
|
||||||
import 'package:cross_file/cross_file.dart';
|
import 'package:cross_file/cross_file.dart';
|
||||||
import 'package:fluffychat/config/app_config.dart';
|
import 'package:fluffychat/config/app_config.dart';
|
||||||
|
|
@ -311,11 +310,10 @@ class ChatListController extends State<ChatList>
|
||||||
String? get activeChat => widget.activeChat;
|
String? get activeChat => widget.activeChat;
|
||||||
|
|
||||||
void _processIncomingSharedMedia(List<SharedMediaFile> files) {
|
void _processIncomingSharedMedia(List<SharedMediaFile> files) {
|
||||||
|
files.removeWhere(
|
||||||
|
(file) => file.path.startsWith(AppConfig.deepLinkPrefix) == true,
|
||||||
|
);
|
||||||
if (files.isEmpty) return;
|
if (files.isEmpty) return;
|
||||||
inspect(files);
|
|
||||||
if (files.singleOrNull?.path.startsWith(AppConfig.deepLinkPrefix) == true) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
showScaffoldDialog(
|
showScaffoldDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ class FluffyChatApp extends StatelessWidget {
|
||||||
|
|
||||||
// Pass deep links to app:
|
// Pass deep links to app:
|
||||||
if (state.uri.toString().startsWith(AppConfig.deepLinkPrefix)) {
|
if (state.uri.toString().startsWith(AppConfig.deepLinkPrefix)) {
|
||||||
return '/rooms/newprivatechat?deeplink=${state.uri}';
|
return '/rooms/newprivatechat#${state.uri}';
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue