Closed phamnhuvu-dev closed 1 year ago
The latest version will add late keyword only when create a late field using null-safety. Hence, you have to specify useNullSafetySyntax: true
inside DartEmitter
DartEmitter(useNullSafetySyntax: true)
Refer the test of field: https://github.com/dart-lang/code_builder/blob/master/test/specs/field_test.dart
@Snehal-Singh174 Thank you, I got it
I am not sure if it is a bug or not, I could write these codes by hand
late Machine _machine;
without any problems, so I want to ask about this.Info: Version: code_builder: ^4.4.0 Dart SDK version: 2.18.2 (stable) (Tue Sep 27 13:24:11 2022 +0200) on "macos_arm64"
Code:
Current behavior: Generate:
Expect behavior Generate: