iosWebViewFix/flutter_inappwebview/lib/src/process_global_config.dart

39 lines
1.4 KiB
Dart
Raw Normal View History

2023-11-17 22:28:11 +00:00
import 'dart:async';
import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_platform_interface.dart';
2023-11-24 16:56:57 +00:00
///{@macro flutter_inappwebview_platform_interface.PlatformProcessGlobalConfig}
2023-11-17 22:28:11 +00:00
class ProcessGlobalConfig {
2023-11-24 16:56:57 +00:00
///{@macro flutter_inappwebview_platform_interface.PlatformProcessGlobalConfig}
2023-11-17 22:28:11 +00:00
ProcessGlobalConfig()
: this.fromPlatformCreationParams(
const PlatformProcessGlobalConfigCreationParams(),
);
2023-11-17 22:28:11 +00:00
/// Constructs a [ProcessGlobalConfig] from creation params for a specific
/// platform.
ProcessGlobalConfig.fromPlatformCreationParams(
PlatformProcessGlobalConfigCreationParams params,
) : this.fromPlatform(PlatformProcessGlobalConfig(params));
2023-11-17 22:28:11 +00:00
/// Constructs a [ProcessGlobalConfig] from a specific platform
/// implementation.
ProcessGlobalConfig.fromPlatform(this.platform);
2023-11-24 16:56:57 +00:00
/// Implementation of [PlatformProcessGlobalConfig] for the current platform.
2023-11-17 22:28:11 +00:00
final PlatformProcessGlobalConfig platform;
static ProcessGlobalConfig? _instance;
///Gets the [ProcessGlobalConfig] shared instance.
static ProcessGlobalConfig instance() {
if (_instance == null) {
_instance = ProcessGlobalConfig();
}
return _instance!;
}
2023-11-24 16:56:57 +00:00
///{@macro flutter_inappwebview_platform_interface.PlatformProcessGlobalConfig.apply}
Future<void> apply({required ProcessGlobalConfigSettings settings}) =>
platform.apply(settings: settings);
2023-11-17 22:28:11 +00:00
}