mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Avoid duplicate shortcut creation
This commit is contained in:
@ -6,6 +6,10 @@ import 'package:comunic/models/custom_emoji.dart';
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
class CustomEmojiesList extends AbstractList<CustomEmoji> {
|
||||
/// Check if an emoji, identified by its shortcut, is present in this list
|
||||
bool hasShortcut(String shortcut) =>
|
||||
firstWhere((f) => f.shortcut == shortcut, orElse: () => null) != null;
|
||||
|
||||
/// Serialize this list
|
||||
List<Map<String, dynamic>> toSerializableList() =>
|
||||
map((f) => f.toMap()).toList();
|
||||
|
Reference in New Issue
Block a user