diff --git a/packages/luthor_generator/lib/generators/luthor_generator.dart b/packages/luthor_generator/lib/generators/luthor_generator.dart index 4c8dbd20..69174d48 100644 --- a/packages/luthor_generator/lib/generators/luthor_generator.dart +++ b/packages/luthor_generator/lib/generators/luthor_generator.dart @@ -1,6 +1,5 @@ import 'package:analyzer/dart/element/element.dart'; import 'package:build/build.dart'; -import 'package:collection/collection.dart'; import 'package:luthor/luthor.dart'; import 'package:luthor_generator/checkers.dart'; import 'package:luthor_generator/helpers/validations/base_validations.dart'; @@ -33,7 +32,7 @@ class LuthorGenerator extends GeneratorForAnnotation { final hasFromJsonCtor = element.constructors.any( (element) => element.isFactory && element.name == 'fromJson', ); - if (hasFromJsonCtor) { + if (!hasFromJsonCtor) { throw InvalidGenerationSourceError( 'Luthor can only be applied to classes with a factory fromJson constructor', element: element,