fixed flutter web sandbox enum

This commit is contained in:
Lorenzo Pichilli 2022-10-11 10:34:09 +02:00
parent 310cd60a6e
commit 924022686d
5 changed files with 21 additions and 13 deletions

View File

@ -52,7 +52,7 @@ void loadUrl() {
expect(await loadedUrl.future, TEST_CROSS_PLATFORM_URL_1.toString());
}, skip: shouldSkip1);
final shouldSkip2 = kIsWeb ? false :
final shouldSkip2 = kIsWeb ? true :
![
TargetPlatform.iOS,
TargetPlatform.macOS,

View File

@ -3,12 +3,11 @@
export "FLUTTER_ROOT=/Users/lorenzopichilli/fvm/versions/2.10.4"
export "FLUTTER_APPLICATION_PATH=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/lib/main.dart"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=/Users/lorenzopichilli/Desktop/flutter_inappwebview/example/.dart_tool/package_config.json"
export "PACKAGE_CONFIG=.dart_tool/package_config.json"

View File

@ -40,16 +40,23 @@ class Sandbox_ {
String? toValue() => _value;
@override
String toString() =>
_value == null ? "allow-all" : (_value == "" ? "allow-none" : "");
String toString() {
if (_value == null)
return 'allow-all';
if (_value == '')
return 'allow-none';
return _value ?? '';
}
static const _ALL = const Sandbox_._internal(null);
static const _NONE = const Sandbox_._internal("");
///Allow all.
@ExchangeableEnumCustomValue()
static const ALLOW_ALL = const [_ALL];
///Allow none.
@ExchangeableEnumCustomValue()
static const ALLOW_NONE = const [_NONE];
///Allows for downloads to occur with a gesture from the user.

View File

@ -18,10 +18,10 @@ class Sandbox {
static const _NONE = Sandbox._internal('', '');
///Allow all.
static const ALLOW_ALL = Sandbox._internal(null, null);
static const ALLOW_ALL = const [_ALL];
///Allow none.
static const ALLOW_NONE = Sandbox._internal(null, null);
static const ALLOW_NONE = const [_NONE];
///Allows for downloads to occur with a gesture from the user.
static const ALLOW_DOWNLOADS =
@ -74,8 +74,6 @@ class Sandbox {
///Set of all values of [Sandbox].
static final Set<Sandbox> values = [
Sandbox.ALLOW_ALL,
Sandbox.ALLOW_NONE,
Sandbox.ALLOW_DOWNLOADS,
Sandbox.ALLOW_FORMS,
Sandbox.ALLOW_MODALS,
@ -122,8 +120,11 @@ class Sandbox {
///Gets [String] value.
String? toValue() => _value;
@override
String toString() =>
_value == null ? "allow-all" : (_value == "" ? "allow-none" : "");
String toString() {
if (_value == null) return 'allow-all';
if (_value == '') return 'allow-none';
return _value ?? '';
}
///Gets [String?] native value.
String? toNativeValue() => _nativeValue;

View File

@ -28,7 +28,8 @@ var options = {
cert: fs.readFileSync('server-crt.pem'),
ca: fs.readFileSync('ca-crt.pem'),
requestCert: true,
rejectUnauthorized: false
rejectUnauthorized: false,
ciphers: "DEFAULT:@SECLEVEL=0"
};
appHttps.get('/', (req, res) => {