fromMap static method
Gets a possible ChromeSafariBrowserSettings instance from a Map value.
Implementation
static ChromeSafariBrowserSettings? fromMap(Map<String, dynamic>? map) {
if (map == null) {
return null;
}
final instance = ChromeSafariBrowserSettings(
activityButton: ActivityButton.fromMap(
map['activityButton']?.cast<String, dynamic>()),
displayMode: _deserializeDisplayMode(map['displayMode']),
eventAttribution: UIEventAttribution.fromMap(
map['eventAttribution']?.cast<String, dynamic>()),
exitAnimations: map['exitAnimations'] != null
? List<AndroidResource>.from(map['exitAnimations']
.map((e) => AndroidResource.fromMap(e?.cast<String, dynamic>())!))
: null,
navigationBarColor: map['navigationBarColor'] != null
? UtilColor.fromStringRepresentation(map['navigationBarColor'])
: null,
navigationBarDividerColor: map['navigationBarDividerColor'] != null
? UtilColor.fromStringRepresentation(map['navigationBarDividerColor'])
: null,
packageName: map['packageName'],
preferredBarTintColor: map['preferredBarTintColor'] != null
? UtilColor.fromStringRepresentation(map['preferredBarTintColor'])
: null,
preferredControlTintColor: map['preferredControlTintColor'] != null
? UtilColor.fromStringRepresentation(map['preferredControlTintColor'])
: null,
secondaryToolbarColor: map['secondaryToolbarColor'] != null
? UtilColor.fromStringRepresentation(map['secondaryToolbarColor'])
: null,
startAnimations: map['startAnimations'] != null
? List<AndroidResource>.from(map['startAnimations']
.map((e) => AndroidResource.fromMap(e?.cast<String, dynamic>())!))
: null,
toolbarBackgroundColor: map['toolbarBackgroundColor'] != null
? UtilColor.fromStringRepresentation(map['toolbarBackgroundColor'])
: null,
);
instance.additionalTrustedOrigins = map['additionalTrustedOrigins'] != null
? List<String>.from(map['additionalTrustedOrigins']!.cast<String>())
: null;
instance.alwaysUseBrowserUI = map['alwaysUseBrowserUI'];
instance.barCollapsingEnabled = map['barCollapsingEnabled'];
instance.dismissButtonStyle =
DismissButtonStyle.fromNativeValue(map['dismissButtonStyle']);
instance.enableUrlBarHiding = map['enableUrlBarHiding'];
instance.entersReaderIfAvailable = map['entersReaderIfAvailable'];
instance.instantAppsEnabled = map['instantAppsEnabled'];
instance.isSingleInstance = map['isSingleInstance'];
instance.isTrustedWebActivity = map['isTrustedWebActivity'];
instance.keepAliveEnabled = map['keepAliveEnabled'];
instance.noHistory = map['noHistory'];
instance.presentationStyle =
ModalPresentationStyle.fromNativeValue(map['presentationStyle']);
instance.screenOrientation =
TrustedWebActivityScreenOrientation.fromNativeValue(
map['screenOrientation']);
instance.shareState =
CustomTabsShareState.fromNativeValue(map['shareState']);
instance.showTitle = map['showTitle'];
instance.transitionStyle =
ModalTransitionStyle.fromNativeValue(map['transitionStyle']);
return instance;
}