Skip to content

Commit f332c9e

Browse files
ci: bump version to v0.9.19
1 parent 9cc8daf commit f332c9e

File tree

4 files changed

+51
-24
lines changed

4 files changed

+51
-24
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [0.9.19]
4+
5+
- Released @ 6/2025 (UTC)
6+
- Critical bugfix
7+
38
## [0.9.18]
49

510
- Released @ 6/2025 (UTC)

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Dart & Flutter Packages by dev-cetera.com & contributors.
55

66
[![pub](https://img.shields.io/pub/v/df_generate_dart_models_core.svg)](https://pub.dev/packages/df_generate_dart_models_core)
7-
[![tag](https://img.shields.io/badge/tag-v0.9.18-purple)](https://github.com/dev-cetera/df_generate_dart_models_core/tree/v0.9.18)
7+
[![tag](https://img.shields.io/badge/tag-v0.9.19-purple)](https://github.com/dev-cetera/df_generate_dart_models_core/tree/v0.9.19)
88
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/dev-cetera/df_generate_dart_models_core/main/LICENSE)
99

1010
---
@@ -49,4 +49,3 @@ If you're enjoying this package and find it valuable, consider showing your appr
4949
## License
5050

5151
This project is released under the [MIT License](https://raw.githubusercontent.com/dev-cetera/df_generate_dart_models_core/main/LICENSE). See [LICENSE](https://raw.githubusercontent.com/dev-cetera/df_generate_dart_models_core/main/LICENSE) for more information.
52-

lib/src/_utils/dart_from_record_on_dart_object_x.dart

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
3232
/// Returns `fieldName` property from [dartObj] if it matches the structure of
3333
/// [TFieldRecord] or `null`.
3434
List<String>? fieldPathFromRecord() {
35-
return _rawFieldPathFromRecord()?.map((e) => e.replaceAll('?', '')).toList();
35+
return _rawFieldPathFromRecord()
36+
?.map((e) => e.replaceAll('?', ''))
37+
.toList();
3638
}
3739

3840
List<String>? _rawFieldPathFromRecord() {
@@ -48,20 +50,30 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
4850
String? fieldTypeFromRecord() {
4951
final raw = _rawFieldTypeFromRecord();
5052
if (raw != null) {
51-
return raw.endsWith('?') || raw.endsWith('*') ? raw.substring(0, raw.length - 1) : raw;
53+
return raw.endsWith('?') || raw.endsWith('*')
54+
? raw.substring(0, raw.length - 1)
55+
: raw;
5256
}
5357
return null;
5458
}
5559

5660
String? _rawFieldTypeFromRecord() {
5761
final a = dartObj.getField('\$2')?.toStringValue() as String?;
5862
final b =
59-
dartObj.getField('\$2')?.toTypeValue()?.getDisplayString(withNullability: true) as String?;
60-
final c = dartObj.getField(FieldModelFieldNames.fieldType)?.toStringValue() as String?;
61-
final d = dartObj
62-
.getField(FieldModelFieldNames.fieldType)
63-
?.toTypeValue()
64-
?.getDisplayString(withNullability: true) as String?;
63+
dartObj
64+
.getField('\$2')
65+
?.toTypeValue()
66+
?.getDisplayString(withNullability: true)
67+
as String?;
68+
final c =
69+
dartObj.getField(FieldModelFieldNames.fieldType)?.toStringValue()
70+
as String?;
71+
final d =
72+
dartObj
73+
.getField(FieldModelFieldNames.fieldType)
74+
?.toTypeValue()
75+
?.getDisplayString(withNullability: true)
76+
as String?;
6577
return a ?? b ?? c ?? d;
6678
}
6779

@@ -72,7 +84,8 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
7284
return false;
7385
}
7486

75-
final a = dartObj.getField(FieldModelFieldNames.nullable)?.toBoolValue() as bool?;
87+
final a =
88+
dartObj.getField(FieldModelFieldNames.nullable)?.toBoolValue() as bool?;
7689
final b = dartObj.getField('\$3')?.toBoolValue() as bool?;
7790
final c = _rawFieldPathFromRecord()?.any((e) => e.contains('?'));
7891
final d = _rawFieldTypeFromRecord()?.endsWith('?');
@@ -82,25 +95,32 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
8295
/// Returns the `children` property from [dartObj] if it matches the structure of
8396
/// [TFieldRecord] or `null`.
8497
List<Map<String, dynamic>>? childrenFromRecord() {
85-
final a = dartObj.getField(FieldModelFieldNames.children)?.toListValue()?.map(
86-
(e) => e.toMapValue()!.map(
87-
(k, v) => MapEntry(k!.toStringValue()!, dartObjToObject(v)),
88-
),
89-
) as Iterable?;
98+
final a =
99+
dartObj
100+
.getField(FieldModelFieldNames.children)
101+
?.toListValue()
102+
?.map(
103+
(e) => e.toMapValue()!.map(
104+
(k, v) => MapEntry(k!.toStringValue()!, dartObjToObject(v)),
105+
),
106+
)
107+
as Iterable?;
90108
final b = a?.map((e) => (e as Map).cast<String, dynamic>()).toList();
91109
return b;
92110
}
93111

94112
/// Returns the `primaryKey` property from [dartObj] if it matches the structure
95113
/// of [TFieldRecord] or `null`.
96114
bool? primaryKeyFromRecord() {
97-
return dartObj.getField(FieldModelFieldNames.primaryKey)?.toBoolValue() as bool?;
115+
return dartObj.getField(FieldModelFieldNames.primaryKey)?.toBoolValue()
116+
as bool?;
98117
}
99118

100119
/// Returns the `foreignKey` property from [dartObj] if it matches the
101120
/// structure of [TFieldRecord] or `null`.
102121
bool? foreignKeyFromRecord() {
103-
return dartObj.getField(FieldModelFieldNames.foreignKey)?.toBoolValue() as bool?;
122+
return dartObj.getField(FieldModelFieldNames.foreignKey)?.toBoolValue()
123+
as bool?;
104124
}
105125

106126
/// Retrieves the `fallback` property from this `DartObject` if it matches
@@ -113,6 +133,7 @@ extension type DartFromRecordOnDartObjectX(_DartObject dartObj) {
113133
/// Returns the `description` property from [dartObj] record if it matches the
114134
/// structure of [TFieldRecord] or `null`.
115135
String? descriptionFromRecord() {
116-
return dartObj.getField(FieldModelFieldNames.description)?.toStringValue() as String?;
136+
return dartObj.getField(FieldModelFieldNames.description)?.toStringValue()
137+
as String?;
117138
}
118139
}

lib/src/_utils/dart_obj_to_string_list.dart

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ List<String>? dartObjToStringList(dynamic dartObj) {
1717
if (a != null) {
1818
return [a];
1919
}
20-
final b = dartObj
21-
?.toListValue()
22-
?.map((e) => e.toStringValue())
23-
.where((e) => e != null)
24-
.map((e) => e!) as Iterable?;
20+
final b =
21+
dartObj
22+
?.toListValue()
23+
?.map((e) => e.toStringValue())
24+
.where((e) => e != null)
25+
.map((e) => e!)
26+
as Iterable?;
2527

2628
final c = b?.map((e) => e.toString()).toList();
2729
return c;

0 commit comments

Comments
 (0)