Skip to content

Commit 540a7ae

Browse files
committed
+Critical bugfix
1 parent 1057669 commit 540a7ae

File tree

5 files changed

+20
-81
lines changed

5 files changed

+20
-81
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ 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_gen_core/main/LICENSE). See [LICENSE](https://raw.githubusercontent.com/dev-cetera/df_gen_core/main/LICENSE) for more information.
52+

flutter_analysis_options.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

lib/src/language_support/dart_annotated_class_analyzer.dart

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ final class DartAnnotatedClassAnalyzer {
8282
fullFileUri.toString(),
8383
);
8484
if (library is LibraryElementResult) {
85-
final classElements = library.element.topLevelElements
86-
.whereType<ClassElement>();
85+
final classElements = library.element.topLevelElements.whereType<ClassElement>();
8786
for (final classElement in classElements) {
8887
final className = classElement.displayName;
8988
if (classNameFilter == null || classNameFilter.hasMatch(className)) {
@@ -138,8 +137,7 @@ final class DartAnnotatedClassAnalyzer {
138137
Set<String>? inclMemberAnnotations,
139138
) async {
140139
for (final fieldElement in classElement.fields) {
141-
if (memberNameFilter == null ||
142-
memberNameFilter.hasMatch(fieldElement.displayName)) {
140+
if (memberNameFilter == null || memberNameFilter.hasMatch(fieldElement.displayName)) {
143141
for (final fieldMetadata in fieldElement.metadata) {
144142
final memberAnnotationName = fieldMetadata.element?.displayName;
145143
if (memberAnnotationName != null &&
@@ -199,8 +197,7 @@ final class DartAnnotatedClassAnalyzer {
199197
Set<String>? inclMethodAnnotations,
200198
) async {
201199
for (final method in classElement.methods) {
202-
if (methodNameFilter == null ||
203-
methodNameFilter.hasMatch(method.displayName)) {
200+
if (methodNameFilter == null || methodNameFilter.hasMatch(method.displayName)) {
204201
for (final methodMetadata in method.metadata) {
205202
final methodAnnotationName = methodMetadata.element?.displayName;
206203
if (methodAnnotationName != null &&
@@ -217,9 +214,7 @@ final class DartAnnotatedClassAnalyzer {
217214
final fieldNames = element?.children.map((e) => e.displayName);
218215
if (fieldNames != null) {
219216
for (final fieldName in fieldNames) {
220-
final fieldValue = methodMetadata
221-
.computeConstantValue()
222-
?.getField(fieldName);
217+
final fieldValue = methodMetadata.computeConstantValue()?.getField(fieldName);
223218
if (fieldValue != null) {
224219
await onMethodAnnotationField(
225220
OnMethodAnnotationFieldParams(
@@ -267,8 +262,8 @@ final class DartAnnotatedClassAnalyzer {
267262
if (fieldNames != null) {
268263
for (final fieldName in fieldNames) {
269264
final fieldValue = metadata.computeConstantValue()?.getField(
270-
fieldName,
271-
);
265+
fieldName,
266+
);
272267
if (fieldValue != null) {
273268
await onClassAnnotationField(
274269
OnClassAnnotationFieldParams(
@@ -303,8 +298,7 @@ final class OnAnnotatedClassParams {
303298
});
304299
}
305300

306-
typedef TOnAnnotatedClassCallback =
307-
Future<dynamic> Function(OnAnnotatedClassParams parent);
301+
typedef TOnAnnotatedClassCallback = Future<dynamic> Function(OnAnnotatedClassParams parent);
308302

309303
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
310304

@@ -325,8 +319,8 @@ final class OnClassAnnotationFieldParams {
325319
});
326320
}
327321

328-
typedef TOnClassAnnotationFieldCallback =
329-
Future<dynamic> Function(OnClassAnnotationFieldParams parent);
322+
typedef TOnClassAnnotationFieldCallback = Future<dynamic> Function(
323+
OnClassAnnotationFieldParams parent);
330324

331325
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
332326

@@ -345,8 +339,7 @@ final class OnAnnotatedMethodParams {
345339
});
346340
}
347341

348-
typedef TOnAnnotatedMethodCallback =
349-
Future<dynamic> Function(OnAnnotatedMethodParams parent);
342+
typedef TOnAnnotatedMethodCallback = Future<dynamic> Function(OnAnnotatedMethodParams parent);
350343

351344
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
352345

@@ -367,8 +360,8 @@ final class OnMethodAnnotationFieldParams {
367360
});
368361
}
369362

370-
typedef TOnMethodAnnotationFieldCallback =
371-
Future<dynamic> Function(OnMethodAnnotationFieldParams parent);
363+
typedef TOnMethodAnnotationFieldCallback = Future<dynamic> Function(
364+
OnMethodAnnotationFieldParams parent);
372365

373366
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
374367

@@ -389,8 +382,7 @@ final class OnAnnotatedMemberParams {
389382
});
390383
}
391384

392-
typedef TOnAnnotatedMemberCallback =
393-
Future<dynamic> Function(OnAnnotatedMemberParams parent);
385+
typedef TOnAnnotatedMemberCallback = Future<dynamic> Function(OnAnnotatedMemberParams parent);
394386

395387
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
396388

@@ -411,8 +403,8 @@ final class OnMemberAnnotationFieldParams {
411403
});
412404
}
413405

414-
typedef TOnMemberAnnotationFieldsCallback =
415-
Future<dynamic> Function(OnMemberAnnotationFieldParams parent);
406+
typedef TOnMemberAnnotationFieldsCallback = Future<dynamic> Function(
407+
OnMemberAnnotationFieldParams parent);
416408

417409
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
418410

lib/src/mappers_etc.dart

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ String buildCollectionMapper(
3939
.._largs = Iterable.generate(pLength, (n) => n).map((n) => 'p$n')
4040
.._type = element[1];
4141
final argIdMatch = RegExp(r'#x(\d+)').firstMatch(output);
42-
collectionEvent._nameIndex =
43-
argIdMatch != null &&
44-
argIdMatch.groupCount >
45-
0 //
42+
collectionEvent._nameIndex = argIdMatch != null && argIdMatch.groupCount > 0 //
4643
? int.tryParse(argIdMatch.group(1)!)
4744
: null;
4845
final xHash = '#x${collectionEvent._nameIndex}';
@@ -159,8 +156,7 @@ TTypeMappers filterMappersByType(TTypeMappers mappers, String type) {
159156

160157
// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
161158

162-
typedef TTypeMappers<E extends MapperEvent> =
163-
Map<String, String Function(E event)>;
159+
typedef TTypeMappers<E extends MapperEvent> = Map<String, String Function(E event)>;
164160

165161
TTypeMappers<T> newTypeMap<T extends MapperEvent>(
166162
Map<String, String Function(T)> src,
@@ -177,8 +173,7 @@ TTypeMappers<T> newTypeMap<T extends MapperEvent>(
177173
abstract class TypeMappers {
178174
TTypeMappers<MapperEvent> get fromMappers =>
179175
{...collectionFromMappers, ...objectFromMappers}.cast();
180-
TTypeMappers<MapperEvent> get toMappers =>
181-
{...collectionToMappers, ...objectToMappers}.cast();
176+
TTypeMappers<MapperEvent> get toMappers => {...collectionToMappers, ...objectToMappers}.cast();
182177
TTypeMappers<CollectionMapperEvent> get collectionFromMappers;
183178
TTypeMappers<CollectionMapperEvent> get collectionToMappers;
184179
TTypeMappers<ObjectMapperEvent> get objectFromMappers;

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repository: https://github.com/dev-cetera/df_gen_core
1616
funding:
1717
- https://www.buymeacoffee.com/dev_cetera
1818
description: A package that provides core utilities for practical code generation.
19-
version: 0.6.12
19+
version: 0.6.13
2020

2121
## -----------------------------------------------------------------------------
2222

0 commit comments

Comments
 (0)