Skip to content

Commit 3d8793c

Browse files
committed
update
1 parent 696872f commit 3d8793c

File tree

7 files changed

+181
-213
lines changed

7 files changed

+181
-213
lines changed

.github/scripts/update_changelog.dart

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ void main(List<String> args) {
2828
final sections = extractSections(contents);
2929
final versionExist = sections.where((e) => e.version == version).isNotEmpty;
3030
if (versionExist) {
31-
sections.where((e) => e.version == version).forEach((e) {
32-
e.addUpdate(comitMesssage);
33-
});
31+
for (final versionSection in sections.where((e) => e.version == version)) {
32+
if (comitMesssage.isNotEmpty) {
33+
versionSection.addUpdate(comitMesssage);
34+
}
35+
}
3436
} else {
3537
sections.add(
3638
_VersionSection(
@@ -76,11 +78,13 @@ Set<_VersionSection> extractSections(String contents) {
7678
updates.add(line);
7779
}
7880
}
79-
results.add(_VersionSection(
80-
version: version,
81-
releasedAt: releasedAt,
82-
updates: updates,
83-
));
81+
results.add(
82+
_VersionSection(
83+
version: version,
84+
releasedAt: releasedAt,
85+
updates: updates,
86+
),
87+
);
8488
}
8589

8690
return results;
@@ -105,7 +109,7 @@ class _VersionSection {
105109
required this.version,
106110
required this.releasedAt,
107111
Set<String>? updates,
108-
}) : this.updates = updates ?? {};
112+
}) : updates = updates ?? {};
109113

110114
//
111115
//

.github/workflows/deploy-examplet.yml_REMOVE_TO_ENABLE renamed to .github/workflows/deploy-example.yml_REMOVE_TO_ENABLE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Build the web app in /hosted_example/
5050
- name: Build web app in /hosted_example/
51-
run: flutter build web --release --base-href "/${{ github.event.repository.name }}/"
51+
run: flutter build web --release --wasm --base-href "/${{ github.event.repository.name }}/"
5252
working-directory: ./hosted_example
5353

5454
# Necessary

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Open the terminal and navigate to `lib/models/model_user`, then run `-models`. T
9191

9292
---
9393

94-
Please refer to the [API reference](https://pub.dev/documentation/df_generate_dart_models/) for more information.
94+
☝️ Please refer to the [API reference](https://pub.dev/documentation/df_generate_dart_models/) for more information.
9595

9696
---
9797

@@ -118,6 +118,7 @@ If you're enjoying this package and find it valuable, consider showing your appr
118118

119119
<a href="https://www.buymeacoffee.com/dev_cetera" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" height="40"></a>
120120

121-
## License
121+
## 🧑‍⚖️ License
122122

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

bin/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ dependencies:
3232
## -----------------------------------------------------------------------------
3333

3434
dev_dependencies:
35-
lints: ^6.0.0
35+
lints: ^6.0.0

lib/src/extract_insights_from_file.dart

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ Future<List<ClassInsight<GenerateDartModel>>> extractInsightsFromFile(
3737
await analyzer.analyze(
3838
inclClassAnnotations: {GenerateDartModel.CLASS_NAME},
3939
inclMemberAnnotations: {Field.CLASS_NAME},
40-
onClassAnnotationField: (p) async =>
41-
temp = _updateFromClassAnnotationField(temp, p),
40+
onClassAnnotationField: (p) async => temp = _updateFromClassAnnotationField(temp, p),
4241
onAnnotatedMember: (p) async => temp = _updateFromAnnotatedMember(temp, p),
4342
onPreAnalysis: (_, className) => temp = const GenerateDartModel(fields: {}),
4443
onPostAnalysis: (params) {
@@ -142,32 +141,23 @@ GenerateDartModel _updateFromAnnotatedMember(
142141
params.memberAnnotationFields[FieldModelFieldNames.fieldPath],
143142
);
144143
final a2 = [params.memberName];
145-
final b1 = params.memberAnnotationFields[FieldModelFieldNames.fieldType]
146-
?.toStringValue();
144+
final b1 = params.memberAnnotationFields[FieldModelFieldNames.fieldType]?.toStringValue();
145+
// ignore: deprecated_member_use
147146
final b2 = params.memberType.getDisplayString(withNullability: false);
148-
final nullable = params
149-
.memberAnnotationFields[FieldModelFieldNames.nullable]
150-
?.toBoolValue();
151-
final primaryKey = params
152-
.memberAnnotationFields[FieldModelFieldNames.primaryKey]
153-
?.toBoolValue();
154-
final foreignKey = params
155-
.memberAnnotationFields[FieldModelFieldNames.foreignKey]
156-
?.toBoolValue();
157-
final children =
158-
(dartObjToObject(
159-
params.memberAnnotationFields[FieldModelFieldNames.children],
160-
)
161-
as List?)
162-
?.map((e) => (e as Map).map((k, v) => MapEntry(k.toString(), v)))
163-
.nonNulls
164-
.toList();
165-
final fallback = params
166-
.memberAnnotationFields[FieldModelFieldNames.fallback]
167-
?.toListValue();
168-
final description = params
169-
.memberAnnotationFields[FieldModelFieldNames.description]
170-
?.toStringValue();
147+
final nullable = params.memberAnnotationFields[FieldModelFieldNames.nullable]?.toBoolValue();
148+
final primaryKey =
149+
params.memberAnnotationFields[FieldModelFieldNames.primaryKey]?.toBoolValue();
150+
final foreignKey =
151+
params.memberAnnotationFields[FieldModelFieldNames.foreignKey]?.toBoolValue();
152+
final children = (dartObjToObject(
153+
params.memberAnnotationFields[FieldModelFieldNames.children],
154+
) as List?)
155+
?.map((e) => (e as Map).map((k, v) => MapEntry(k.toString(), v)))
156+
.nonNulls
157+
.toList();
158+
final fallback = params.memberAnnotationFields[FieldModelFieldNames.fallback]?.toListValue();
159+
final description =
160+
params.memberAnnotationFields[FieldModelFieldNames.description]?.toStringValue();
171161
final field = DartField(
172162
fieldPath: a1 ?? a2,
173163
fieldType: b1 ?? b2,

0 commit comments

Comments
 (0)