Skip to content

Replace " by ' for the dart language #1625

@Hesamedin

Description

@Hesamedin

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,
      };
}
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions