VS Code/Cursor extension that automatically formats Freezed models in Go-style alignment after dart format.
Before
@freezed
class User with _$User {
const factory User({
@JsonKey(name: 'id') @Default(0) int id,
@JsonKey(name: 'email') required String email,
@JsonKey(name: 'full_name') @Default('') String fullName,
@JsonKey(name: 'age') int? age,
@JsonKey(name: 'is_active') @Default(true) bool isActive,
@JsonKey(name: 'tags') @Default([]) List<String> tags,
@JsonKey(name: 'metadata') Map<String, dynamic>? metadata,
@JsonKey(name: 'created_at') DateTime? createdAt,
}) = _User;
}
After
@FreezedGoStyle()
@freezed
class User with _$User {
const factory User({
@JsonKey(name: 'id') @Default(0) int id,
@JsonKey(name: 'email') required String email,
@JsonKey(name: 'full_name') @Default('') String fullName,
@JsonKey(name: 'age') int? age,
@JsonKey(name: 'is_active') @Default(true) bool isActive,
@JsonKey(name: 'tags') @Default([]) List<String> tags,
@JsonKey(name: 'metadata') Map<String, dynamic>? metadata,
@JsonKey(name: 'created_at') DateTime? createdAt,
}) = _User;
}
Features
- ✅ Automatically runs after
dart format (Cmd+S / Ctrl+S)
- ✅ Formats only classes with
@FreezedGoStyle annotation
- ✅ Fast native executable for instant formatting
- ✅ Zero configuration needed
How It Works
- Save your Dart file (Cmd+S / Ctrl+S)
dart format runs automatically
- Extension detects save and formats classes with
@FreezedGoStyle() annotation
- File reloads with Go-style aligned parameters
Requirements
- VS Code/Cursor 1.80.0+
- Dart SDK installed
freezed_go_style package in workspace (or parent directory)
Links
License
MIT License