diff --git a/example/lib/main.dart b/example/lib/main.dart index 2733d2e0..09cc265e 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_window_close/flutter_window_close.dart'; +import 'package:livekit_client/livekit_client.dart'; import 'package:livekit_example/theme.dart'; import 'package:logging/logging.dart'; import 'package:intl/intl.dart'; @@ -16,10 +17,13 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); - FlutterWindowClose.setWindowShouldCloseHandler(() async { - await onWindowShouldClose?.call(); - return true; - }); + if (lkPlatformIsDesktop()) { + FlutterWindowClose.setWindowShouldCloseHandler(() async { + await onWindowShouldClose?.call(); + return true; + }); + } + runApp(const LiveKitExampleApp()); } diff --git a/example/lib/pages/room.dart b/example/lib/pages/room.dart index 433fd992..c6ddf02d 100644 --- a/example/lib/pages/room.dart +++ b/example/lib/pages/room.dart @@ -48,7 +48,7 @@ class _RoomPageState extends State { Hardware.instance.setSpeakerphoneOn(true); } - if (!lkPlatformIs(PlatformType.web) && !lkPlatformIsTest()) { + if (lkPlatformIsDesktop()) { onWindowShouldClose = () async { unawaited(widget.room.disconnect()); await _listener.waitFor(