quicktype
quicktype copied to clipboard
Replace `"` by `'` for the dart language
Please add an option in the Options list that let me replace "
by '
. This is the recommended notation by Dart.
For instance, this is the code generated by your interface:
class UsaState {
UsaState({
@required this.name,
@required this.abbreviation,
});
final String name;
final String abbreviation;
factory UsaState.fromJson(Map<String, dynamic> json) => UsaState(
name: json["name"],
abbreviation: json["abbreviation"],
);
Map<String, dynamic> toJson() => {
"name": name,
"abbreviation": abbreviation,
};
}
This is what it needs to be in Dart:
class UsaState {
UsaState({
@required this.name,
@required this.abbreviation,
});
final String name;
final String abbreviation;
factory UsaState.fromJson(Map<String, dynamic> json) => UsaState(
name: json['name'],
abbreviation: json['abbreviation'],
);
Map<String, dynamic> toJson() => {
'name': name,
'abbreviation': abbreviation,
};
}
``
Single quotes are the standard. The tool should just generate single quotes.