getRecentEmojis method
Returns list of recently used emoji from cache
Implementation
Future<List<RecentEmoji>> getRecentEmojis() async {
// final prefs = await SharedPreferences.getInstance();
// var emojiJson = prefs.getString('recent');
var emojiJson = SpUtil.getString("recent");
if (emojiJson == null) {
return [];
}
var json = jsonDecode(emojiJson) as List<dynamic>;
return json.map<RecentEmoji>(RecentEmoji.fromJson).toList();
}