Skip to content

Commit 5dbcfb4

Browse files
committed
+fix: Minor bugfix
1 parent 440c49b commit 5dbcfb4

File tree

3 files changed

+18
-24
lines changed

3 files changed

+18
-24
lines changed

.github/scripts/update_changelog.dart

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ void main(List<String> args) {
4040
),
4141
);
4242
}
43-
contents = '# Changelog\n\n${(sections.toList()..sort((a, b) {
44-
return compareVersions(b.version, a.version);
45-
})).map((e) => e.toString()).join('\n')}';
43+
contents =
44+
'# Changelog\n\n${(sections.toList()..sort((a, b) {
45+
return compareVersions(b.version, a.version);
46+
})).map((e) => e.toString()).join('\n')}';
4647

4748
file.writeAsStringSync(contents);
4849
print('Changelog updated with version $version.');
@@ -59,8 +60,9 @@ Set<_VersionSection> extractSections(String contents) {
5960
final end = i + 1 < allVersionMatches.length ? allVersionMatches[i + 1].start : contents.length;
6061
final sectionContents = contents.substring(start, end).trim();
6162
final lines = sectionContents.split('\n').where((line) => line.isNotEmpty).toList();
62-
final version =
63-
allVersionMatches[i].group(0)!.substring(4, allVersionMatches[i].group(0)!.length - 1);
63+
final version = allVersionMatches[i]
64+
.group(0)!
65+
.substring(4, allVersionMatches[i].group(0)!.length - 1);
6466
var releasedAt = DateTime.now().toUtc();
6567
final updates = <String>{};
6668
final old = lines
@@ -76,13 +78,7 @@ Set<_VersionSection> extractSections(String contents) {
7678
updates.add(line);
7779
}
7880
}
79-
results.add(
80-
_VersionSection(
81-
version: version,
82-
releasedAt: releasedAt,
83-
updates: updates,
84-
),
85-
);
81+
results.add(_VersionSection(version: version, releasedAt: releasedAt, updates: updates));
8682
}
8783

8884
return results;
@@ -103,11 +99,8 @@ class _VersionSection {
10399
//
104100
//
105101

106-
_VersionSection({
107-
required this.version,
108-
required this.releasedAt,
109-
this.updates = const {},
110-
});
102+
_VersionSection({required this.version, required this.releasedAt, Set<String>? updates})
103+
: this.updates = updates ?? {};
111104

112105
//
113106
//

lib/src/models/referenced_model.dart/referenced_model.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ const REFERENCED_MODEL_FIELDS = {
2424
fieldType: String,
2525
nullable: false,
2626
primaryKey: true,
27-
description:
28-
'The unique identifier for the document, serving as its primary key.',
27+
description: 'The unique identifier for the document, serving as its primary key.',
2928
),
3029
Field(
3130
fieldPath: ['ref'],
@@ -38,16 +37,18 @@ const REFERENCED_MODEL_FIELDS = {
3837
};
3938

4039
@GenerateDartModel(shouldInherit: true, fields: REFERENCED_MODEL_FIELDS)
41-
abstract class _ReferencedModel extends ThisModel<ReferencedModel>
42-
with EquatableMixin {
40+
abstract class _ReferencedModel extends Model with EquatableMixin {
4341
const _ReferencedModel();
4442

4543
//
4644
//
4745
//
4846

47+
ReferencedModel get _model =>
48+
this as ReferencedModel; // Using ThisModel causes come conflicts! So doing this instead...
49+
4950
@override
50-
List<Object?> get props => [model.id, model.ref];
51+
List<Object?> get props => [_model.id, _model.ref];
5152

5253
//
5354
//

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
name: df_generate_dart_models_core
1414
description: A package that provides core dependencies for models generated with df_generate_dart_models.
15-
version: 0.9.9
15+
version: 0.9.10
1616
homepage: https://dev-cetera.com
1717
repository: https://github.com/dev-cetera/df_generate_dart_models_core
1818
funding:
@@ -41,5 +41,5 @@ dependencies:
4141
## -----------------------------------------------------------------------------
4242

4343
dev_dependencies:
44-
lints: ^5.1.1
44+
lints: ^6.0.0
4545
test: ^1.26.2

0 commit comments

Comments
 (0)