Skip to content

建议生成fromJson时,提供自定义方法来创建 #1

Description

@826327700

例如:factory Simple.fromJson(Map<String, dynamic> json) => Simple(
firstField: json['firstField'] as String,
secondField: json['secondField'] as int,
thirdField: json['third_field'] as bool?,
); 其中的firstField可能是空的需要赋值默认值,或者可能需要转数字,或者可能需要转DateTime等等情况

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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