fix(mobile): 웹 프리뷰 부트스트랩을 안정화한다

This commit is contained in:
toki 2026-06-05 14:32:00 +09:00
parent 8bdbc75b4b
commit e0afa2fa79

View file

@ -1,4 +1,5 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -9,9 +10,7 @@ import '../integrations/proto_socket/proto_socket_endpoint_config.dart';
import '../integrations/proto_socket/proto_socket_lifecycle.dart';
import 'nomadcode_client_app.dart';
final _mattermostHost = MattermostPushHostIntegration(
pushClient: MattermostPushPluginClient(),
);
MattermostPushHostIntegration? _mattermostHost;
final _navigatorKey = GlobalKey<NavigatorState>();
/// proto-socket lifecycle wired with the concrete connector. Bootstrap does
@ -21,6 +20,12 @@ final _protoSocketLifecycle = ProtoSocketLifecycle(
);
ProtoSocketEndpointConfig? _protoSocketConfig;
MattermostPushHostIntegration _ensureMattermostHost() {
return _mattermostHost ??= MattermostPushHostIntegration(
pushClient: MattermostPushPluginClient(),
);
}
Future<void> applyFullscreenMode() async {
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
SystemChrome.setSystemUIOverlayStyle(
@ -34,8 +39,10 @@ Future<void> applyFullscreenMode() async {
Future<void> bootstrapNomadCodeClient() async {
await applyFullscreenMode();
await Firebase.initializeApp();
await _mattermostHost.initialize();
if (!kIsWeb) {
await Firebase.initializeApp();
await _ensureMattermostHost().initialize();
}
_protoSocketConfig = ProtoSocketEndpointConfig.fromEnv(const {});
}