feat: background and terminated calls [android]
This commit is contained in:
parent
92fa413156
commit
34b039a6c0
18 changed files with 421 additions and 195 deletions
|
|
@ -17,7 +17,7 @@ class FluffyChatApp extends StatefulWidget {
|
|||
final Widget? testWidget;
|
||||
final List<Client> clients;
|
||||
final Map<String, String>? queryParameters;
|
||||
|
||||
static final GlobalKey<VRouterState> routerKey = GlobalKey<VRouterState>();
|
||||
const FluffyChatApp({
|
||||
Key? key,
|
||||
this.testWidget,
|
||||
|
|
@ -35,7 +35,6 @@ class FluffyChatApp extends StatefulWidget {
|
|||
}
|
||||
|
||||
class FluffyChatAppState extends State<FluffyChatApp> {
|
||||
GlobalKey<VRouterState>? _router;
|
||||
bool? columnMode;
|
||||
String? _initialUrl;
|
||||
|
||||
|
|
@ -67,14 +66,13 @@ class FluffyChatAppState extends State<FluffyChatApp> {
|
|||
Logs().v('Set Column Mode = $isColumnMode');
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {
|
||||
_initialUrl = _router?.currentState?.url;
|
||||
_initialUrl = FluffyChatApp.routerKey.currentState?.url;
|
||||
columnMode = isColumnMode;
|
||||
_router = GlobalKey<VRouterState>();
|
||||
});
|
||||
});
|
||||
}
|
||||
return VRouter(
|
||||
key: _router,
|
||||
key: FluffyChatApp.routerKey,
|
||||
title: AppConfig.applicationName,
|
||||
theme: theme,
|
||||
scrollBehavior: CustomScrollBehavior(),
|
||||
|
|
@ -86,7 +84,7 @@ class FluffyChatAppState extends State<FluffyChatApp> {
|
|||
routes: AppRoutes(columnMode ?? false).routes,
|
||||
builder: (context, child) => Matrix(
|
||||
context: context,
|
||||
router: _router,
|
||||
router: FluffyChatApp.routerKey,
|
||||
clients: widget.clients,
|
||||
child: child,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import 'package:vrouter/vrouter.dart';
|
|||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/matrix_sdk_extensions.dart/matrix_locals.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
|
||||
extension LocalNotificationsExtension on MatrixState {
|
||||
|
|
@ -20,7 +21,9 @@ extension LocalNotificationsExtension on MatrixState {
|
|||
final roomId = eventUpdate.roomID;
|
||||
if (activeRoomId == roomId) {
|
||||
if (kIsWeb && webHasFocus) return;
|
||||
if (Platform.isLinux && DesktopLifecycle.instance.isActive.value) return;
|
||||
if (PlatformInfos.isLinux && DesktopLifecycle.instance.isActive.value) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final room = client.getRoomById(roomId);
|
||||
if (room == null) {
|
||||
|
|
|
|||
|
|
@ -427,8 +427,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
voipPlugin = null;
|
||||
return;
|
||||
}
|
||||
voipPlugin =
|
||||
webrtcIsSupported ? VoipPlugin(client: client, context: context) : null;
|
||||
voipPlugin = webrtcIsSupported ? VoipPlugin(client) : null;
|
||||
}
|
||||
|
||||
bool _firstStartup = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue