diff --git a/examples/file_generation_mode/pubspec.lock b/examples/file_generation_mode/pubspec.lock index a17f0f4..b924263 100644 --- a/examples/file_generation_mode/pubspec.lock +++ b/examples/file_generation_mode/pubspec.lock @@ -95,7 +95,7 @@ packages: path: "../../package" relative: true source: path - version: "1.1.0" + version: "1.2.0" file: dependency: transitive description: diff --git a/package/CHANGELOG.md b/package/CHANGELOG.md index 23e2d1a..58daf01 100644 --- a/package/CHANGELOG.md +++ b/package/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.2.0 + +- Bump tachyon version [(issue #353)](https://github.com/spideythewebhead/data_class_plugin/issues/353) +- Update READMEM +- Update example + ## 1.1.0 - Bump dependencies versions [(issue #347)](https://github.com/spideythewebhead/data_class_plugin/issues/347) diff --git a/package/README.md b/package/README.md index 64b5aeb..11ef589 100644 --- a/package/README.md +++ b/package/README.md @@ -100,6 +100,8 @@ These `code actions` are similar to the ones provide by the language - e.g. `wra 1. Create a simple class, annotate it with `@DataClass()` and provide `abstract getter` fields for your model. ```dart + import 'package:data_class_plugin/data_class_plugin.dart'; + @DataClass() class User { String get id; @@ -107,6 +109,54 @@ These `code actions` are similar to the ones provide by the language - e.g. `wra } ``` + Generated code: + + ```dart + class _$UserImpl extends User { + _$UserImpl({ + required this.id, + required this.username, + }) : super.ctor(); + + @override + final String id; + + @override + final String username; + + @override + bool operator ==(Object? other) { + return identical(this, other) || + other is User && + runtimeType == other.runtimeType && + id == other.id && + username == other.username; + } + + @override + int get hashCode { + return Object.hashAll([ + runtimeType, + id, + username, + ]); + } + + @override + String toString() { + String toStringOutput = 'User{}'; + assert(() { + toStringOutput = 'User@<$hexIdentity>{id: $id, username: $username}'; + return true; + }()); + return toStringOutput; + } + + @override + Type get runtimeType => User; + } + ``` + 1. Run code actions on your IDE VSCode diff --git a/package/pubspec.yaml b/package/pubspec.yaml index f574d27..1c02a51 100644 --- a/package/pubspec.yaml +++ b/package/pubspec.yaml @@ -1,5 +1,5 @@ name: data_class_plugin -version: 1.1.0 +version: 1.2.0 description: A tool that uses Dart's Analyzer to generate code on-the-fly. homepage: https://github.com/spideythewebhead/dart_data_class_plugin diff --git a/package/tools/analyzer_plugin/pubspec.yaml b/package/tools/analyzer_plugin/pubspec.yaml index fe9afc9..cb6bb03 100644 --- a/package/tools/analyzer_plugin/pubspec.yaml +++ b/package/tools/analyzer_plugin/pubspec.yaml @@ -9,4 +9,4 @@ environment: sdk: ">=3.1.0 <4.0.0" dependencies: - data_class_plugin: ^1.1.0 + data_class_plugin: ^1.2.0