Skip to content

Can @patch be public? #842

@pouloghost

Description

@pouloghost

I have a cli command to convert gson java file to dart file. i.e.

public class Foo {
  @SerializeName('aaa')
  public String aaa;
}

to

class Foo {
  Foo({this.aaa});

  String aaa;

  ...fromJson...
  ...toJson...
}

Some modifications may be applied to the generated dart, i.e. add a method. Meanwhile dart file should be updated by re-generate using cli, whenever java file gets updated.

Adding a method each re-generation could be avoided by using external and @patch, but @patch is private to dart:_internal.

On external and @patch only, a keyword can only be used with a private meta looks quite strange to me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    requestRequests to resolve a particular developer problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions