diff --git a/CHANGELOG.md b/CHANGELOG.md index 1af066f..80d5bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,7 @@ Initial release ## 1.0.0+1 Fixup readme + +## 1.0.1 + +Remove dependency on `fast_immutable_collections` for users diff --git a/lib/src/controllers/emoji.dart b/lib/src/controllers/emoji.dart index 1b726d1..80f5d36 100644 --- a/lib/src/controllers/emoji.dart +++ b/lib/src/controllers/emoji.dart @@ -28,7 +28,7 @@ class EmojiController extends AsyncNotifier> { (entry) => .new( icon: entry.value.first.emoji.widget, name: entry.key, - emojis: .new(entry.value.map((e) => e.emoji)), + emojis: entry.value.map((e) => e.emoji).toList(), ), ), ); diff --git a/lib/src/models/emoji_category.dart b/lib/src/models/emoji_category.dart index 19936c0..19f556b 100644 --- a/lib/src/models/emoji_category.dart +++ b/lib/src/models/emoji_category.dart @@ -1,4 +1,3 @@ -import "package:fast_immutable_collections/fast_immutable_collections.dart"; import "package:freezed_annotation/freezed_annotation.dart"; import "package:material_emoji_picker/src/models/emoji.dart"; import "package:flutter/widgets.dart"; @@ -8,5 +7,5 @@ part "emoji_category.freezed.dart"; class EmojiCategory({ required final Widget icon, required final String name, - required final IList emojis, + required final List emojis, }) with _$EmojiCategory; diff --git a/lib/src/models/emoji_category.freezed.dart b/lib/src/models/emoji_category.freezed.dart index a0f9c58..e5056d4 100644 --- a/lib/src/models/emoji_category.freezed.dart +++ b/lib/src/models/emoji_category.freezed.dart @@ -51,7 +51,7 @@ abstract mixin class $EmojiCategoryCopyWith<$Res> { factory $EmojiCategoryCopyWith(EmojiCategory value, $Res Function(EmojiCategory) _then) = _$EmojiCategoryCopyWithImpl; @useResult $Res call({ - Widget icon, String name, IList emojis + Widget icon, String name, List emojis }); @@ -73,7 +73,7 @@ class _$EmojiCategoryCopyWithImpl<$Res> icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable as Widget,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,emojis: null == emojis ? _self.emojis : emojis // ignore: cast_nullable_to_non_nullable -as IList, +as List, )); } @@ -85,12 +85,18 @@ as IList, class _EmojiCategory extends EmojiCategory { - _EmojiCategory({required this.icon, required this.name, required this.emojis}): super(icon: icon, name: name, emojis: emojis); + _EmojiCategory({required this.icon, required this.name, required List emojis}): _emojis = emojis,super(icon: icon, name: name, emojis: emojis); @override final Widget icon; @override final String name; -@override final IList emojis; + final List _emojis; +@override List get emojis { + if (_emojis is EqualUnmodifiableListView) return _emojis; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_emojis); +} + /// Create a copy of EmojiCategory /// with the given fields replaced by the non-null parameter values. @@ -102,13 +108,13 @@ _$EmojiCategoryCopyWith<_EmojiCategory> get copyWith => __$EmojiCategoryCopyWith @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _EmojiCategory&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.name, name) || other.name == name)&&const DeepCollectionEquality().equals(other.emojis, emojis)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _EmojiCategory&&(identical(other.icon, icon) || other.icon == icon)&&(identical(other.name, name) || other.name == name)&&const DeepCollectionEquality().equals(other.emojis, _emojis)); } @override int get hashCode { - return Object.hash(runtimeType,icon,name,const DeepCollectionEquality().hash(emojis)); + return Object.hash(runtimeType,icon,name,const DeepCollectionEquality().hash(_emojis)); } @override @@ -124,7 +130,7 @@ abstract mixin class _$EmojiCategoryCopyWith<$Res> implements $EmojiCategoryCopy factory _$EmojiCategoryCopyWith(_EmojiCategory value, $Res Function(_EmojiCategory) _then) = __$EmojiCategoryCopyWithImpl; @override @useResult $Res call({ - Widget icon, String name, IList emojis + Widget icon, String name, List emojis }); @@ -145,8 +151,8 @@ class __$EmojiCategoryCopyWithImpl<$Res> return _then(_EmojiCategory( icon: null == icon ? _self.icon : icon // ignore: cast_nullable_to_non_nullable as Widget,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,emojis: null == emojis ? _self.emojis : emojis // ignore: cast_nullable_to_non_nullable -as IList, +as String,emojis: null == emojis ? _self._emojis : emojis // ignore: cast_nullable_to_non_nullable +as List, )); } diff --git a/lib/src/widgets/emoji_picker.dart b/lib/src/widgets/emoji_picker.dart index 7d819a3..c98ad30 100644 --- a/lib/src/widgets/emoji_picker.dart +++ b/lib/src/widgets/emoji_picker.dart @@ -135,7 +135,7 @@ final class const EmojiPicker({ ) || emoji.tags.join().contains(search.value), ) - .toIList(); + .toList(); return Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/pubspec.yaml b/pubspec.yaml index cb2226f..11b8ba0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: material_emoji_picker description: A generic but configurable emoji picker for Flutter -version: 1.0.0+1 +version: 1.0.1 repository: https://git.federated.nexus/Henry-Hiles/material_emoji_picker issue_tracker: https://git.federated.nexus/Henry-Hiles/material_emoji_picker/issues