fix(mobile): 웹 프리뷰 부트스트랩을 안정화한다
This commit is contained in:
parent
8bdbc75b4b
commit
e0afa2fa79
1 changed files with 12 additions and 5 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:firebase_core/firebase_core.dart';
|
import 'package:firebase_core/firebase_core.dart';
|
||||||
|
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.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 '../integrations/proto_socket/proto_socket_lifecycle.dart';
|
||||||
import 'nomadcode_client_app.dart';
|
import 'nomadcode_client_app.dart';
|
||||||
|
|
||||||
final _mattermostHost = MattermostPushHostIntegration(
|
MattermostPushHostIntegration? _mattermostHost;
|
||||||
pushClient: MattermostPushPluginClient(),
|
|
||||||
);
|
|
||||||
final _navigatorKey = GlobalKey<NavigatorState>();
|
final _navigatorKey = GlobalKey<NavigatorState>();
|
||||||
|
|
||||||
/// proto-socket lifecycle wired with the concrete connector. Bootstrap does
|
/// proto-socket lifecycle wired with the concrete connector. Bootstrap does
|
||||||
|
|
@ -21,6 +20,12 @@ final _protoSocketLifecycle = ProtoSocketLifecycle(
|
||||||
);
|
);
|
||||||
ProtoSocketEndpointConfig? _protoSocketConfig;
|
ProtoSocketEndpointConfig? _protoSocketConfig;
|
||||||
|
|
||||||
|
MattermostPushHostIntegration _ensureMattermostHost() {
|
||||||
|
return _mattermostHost ??= MattermostPushHostIntegration(
|
||||||
|
pushClient: MattermostPushPluginClient(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> applyFullscreenMode() async {
|
Future<void> applyFullscreenMode() async {
|
||||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||||
SystemChrome.setSystemUIOverlayStyle(
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
|
|
@ -34,8 +39,10 @@ Future<void> applyFullscreenMode() async {
|
||||||
|
|
||||||
Future<void> bootstrapNomadCodeClient() async {
|
Future<void> bootstrapNomadCodeClient() async {
|
||||||
await applyFullscreenMode();
|
await applyFullscreenMode();
|
||||||
await Firebase.initializeApp();
|
if (!kIsWeb) {
|
||||||
await _mattermostHost.initialize();
|
await Firebase.initializeApp();
|
||||||
|
await _ensureMattermostHost().initialize();
|
||||||
|
}
|
||||||
|
|
||||||
_protoSocketConfig = ProtoSocketEndpointConfig.fromEnv(const {});
|
_protoSocketConfig = ProtoSocketEndpointConfig.fromEnv(const {});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue