JsonKeyMutate.fromJsonKeyParamaString constructor
JsonKeyMutate.fromJsonKeyParamaString(
- String? theString
Implementation
factory JsonKeyMutate.fromJsonKeyParamaString(String? theString) {
theString = getParameterString(theString);
var newList = theString
?.split(',')
.map((e) => e.split(':'))
.where((element) => element.length > 1)
.map(
(e) {
var theValue = e.last.trim();
var expression = Expression.parse(theValue);
final evaluator = const ExpressionEvaluator();
var theMap = [
e.first,
evaluator.eval(expression, Map<String,dynamic>()),
];
return theMap;
},
);
var newMap = {
if (newList != null)
for (var demo in newList) '${demo.first}': demo.last,
};
return JsonKeyMutate(
defaultValue: newMap['defaultValue'],
disallowNullValue: newMap['disallowNullValue'],
fromJson: newMap['fromJson'],
ignore: newMap['ignore'],
includeIfNull: newMap['includeIfNull'],
name: newMap['name'],
nullable: newMap['nullable'],
required: newMap['required'],
toJson: newMap['toJson'],
unknownEnumValue: newMap['unknownEnumValue'],
);
}