diff --git a/hive/lib/hive.dart b/hive/lib/hive.dart index 92fc9687..5f2dfa27 100644 --- a/hive/lib/hive.dart +++ b/hive/lib/hive.dart @@ -17,6 +17,7 @@ import 'package:hive_ce/src/object/hive_list_impl.dart'; import 'package:hive_ce/src/object/hive_object.dart'; import 'package:hive_ce/src/util/extensions.dart'; import 'package:meta/meta.dart'; +import 'package:meta/meta_meta.dart'; export 'src/box_collection/box_collection_stub.dart' if (dart.library.js_interop) 'package:hive_ce/src/box_collection/box_collection_indexed_db.dart' diff --git a/hive/lib/src/annotations/hive_field.dart b/hive/lib/src/annotations/hive_field.dart index 28583a20..ba42f505 100644 --- a/hive/lib/src/annotations/hive_field.dart +++ b/hive/lib/src/annotations/hive_field.dart @@ -1,13 +1,12 @@ part of '../../hive.dart'; /// Annotate all fields you want to persist with [HiveField]. -// TODO: Enable when Flutter supports analyser 6.5.0 -// @Target({ -// TargetKind.field, -// TargetKind.getter, -// TargetKind.setter, -// TargetKind.enumValue, -// }) +@Target({ + TargetKind.field, + TargetKind.getter, + TargetKind.setter, + TargetKind.enumValue, +}) class HiveField { /// The index of this field. final int index; diff --git a/hive_generator/lib/src/class_builder.dart b/hive_generator/lib/src/class_builder.dart index 3faec4c0..70f7048b 100644 --- a/hive_generator/lib/src/class_builder.dart +++ b/hive_generator/lib/src/class_builder.dart @@ -223,7 +223,5 @@ String _suffixFromType(DartType type) { String _displayString(DartType e) { final suffix = _suffixFromType(e); - // TODO: Update when Flutter supports analyser 6.5.0 - // ignore: deprecated_member_use - return '${e.getDisplayString(withNullability: false)}$suffix'; + return '${e.getDisplayString()}$suffix'; } diff --git a/hive_generator/lib/src/type_adapter_generator.dart b/hive_generator/lib/src/type_adapter_generator.dart index a001e0f5..0cdc42f8 100644 --- a/hive_generator/lib/src/type_adapter_generator.dart +++ b/hive_generator/lib/src/type_adapter_generator.dart @@ -90,18 +90,12 @@ class TypeAdapterGenerator extends GeneratorForAnnotation { final getters = []; final setters = []; for (final name in accessorNames) { - // TODO: Update when Flutter supports analyser 6.5.0 - // ignore: deprecated_member_use - final getter = cls.lookUpGetter(name, library); + final getter = cls.augmented.lookUpGetter(name: name, library: library); if (getter != null) { final getterAnn = - // TODO: Update when Flutter supports analyser 6.5.0 - // ignore: deprecated_member_use - getHiveFieldAnn(getter.variable) ?? getHiveFieldAnn(getter); + getHiveFieldAnn(getter.variable2) ?? getHiveFieldAnn(getter); if (getterAnn != null) { - // TODO: Update when Flutter supports analyser 6.5.0 - // ignore: deprecated_member_use - final field = getter.variable; + final field = getter.variable2!; getters.add( AdapterField( getterAnn.index, @@ -113,18 +107,13 @@ class TypeAdapterGenerator extends GeneratorForAnnotation { } } - // TODO: Update when Flutter supports analyser 6.5.0 - // ignore: deprecated_member_use - final setter = cls.lookUpSetter('$name=', library); + final setter = + cls.augmented.lookUpSetter(name: '$name=', library: library); if (setter != null) { final setterAnn = - // TODO: Update when Flutter supports analyser 6.5.0 - // ignore: deprecated_member_use - getHiveFieldAnn(setter.variable) ?? getHiveFieldAnn(setter); + getHiveFieldAnn(setter.variable2) ?? getHiveFieldAnn(setter); if (setterAnn != null) { - // TODO: Update when Flutter supports analyser 6.5.0 - // ignore: deprecated_member_use - final field = setter.variable; + final field = setter.variable2!; setters.add( AdapterField( setterAnn.index,