From ae13a44f180f563a6180742b90a91db4551dc8bd Mon Sep 17 00:00:00 2001 From: Gabriel Gava Date: Wed, 29 Apr 2026 15:14:39 +0200 Subject: [PATCH] Supporting all analyzer versions from 8.1.1 up to major version 12 - It was not possible to verify with version 13 because build_runner does not support it yet --- functional_data_generator/lib/builder.dart | 2 +- functional_data_generator/pubspec.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/functional_data_generator/lib/builder.dart b/functional_data_generator/lib/builder.dart index f50128e..ff1f0e3 100644 --- a/functional_data_generator/lib/builder.dart +++ b/functional_data_generator/lib/builder.dart @@ -72,7 +72,7 @@ Future _generateDataType(Element element, ConstantReader annotation, Bui final positionalFields = genericConstructor.formalParameters.where((p) => p.isPositional).map((p) => p.name).toList(); final fieldsWithIndex = - await Future.wait(classElement.fields.where((f) => !f.isSynthetic && !f.isStatic).map((f) async { + await Future.wait(classElement.fields.where((f) => f.nonSynthetic == f && !f.isStatic).map((f) async { final declaration = await buildStep.resolver.astNodeFor(f.firstFragment) as VariableDeclaration?; final declarationList = declaration?.parent as VariableDeclarationList?; final positionalIndex = positionalFields.indexOf(f.name); diff --git a/functional_data_generator/pubspec.yaml b/functional_data_generator/pubspec.yaml index bb4e45b..24eaec9 100644 --- a/functional_data_generator/pubspec.yaml +++ b/functional_data_generator/pubspec.yaml @@ -1,5 +1,5 @@ name: functional_data_generator -version: 2.2.2 +version: 2.2.3 description: >- Simple and non-intrusive code generator for boilerplate of data types. homepage: https://github.com/spkersten/dart_functional_data @@ -8,7 +8,7 @@ environment: sdk: '>=2.19.0 <4.0.0' dependencies: - analyzer: '^8.0.0' + analyzer: '>=8.1.1 <13.0.0' build: ^4.0.0 collection: ^1.15.0 functional_data: ^1.1.1