dart-lang / code_builder

A fluent API for generating valid Dart source code
https://pub.dev/packages/code_builder
BSD 3-Clause "New" or "Revised" License
423 stars 66 forks source link

Add private constructor option #451

Open sh1l0n opened 3 months ago

sh1l0n commented 3 months ago

Some libraries as freezed need private constructor to enable some features, could be good to add that option to class code_builder

class Foo {
    const Foo._();
}
PhiFry commented 1 month ago

Private constructor in Dart is a named constructor. So you define the name as _ to make it private.