0

I like to use the newtype pattern for encapsulating strings or other too common data types.
Is there a way I can do this in dart? I found the typedef but apparently this is only for method callbacks.

Example type alias in typescript:

type FileId = string;

Example newtype in rust:

struct FileId(String);
creativecreatorormaybenot
  • 114,516
  • 58
  • 291
  • 402

0 Answers0