setFluttermoji method
Accepts a String fluttermoji
stores fluttermoji in device storage adds the new name to controller
Thereby updating all the states which are listening to controller
Implementation
Future<void> setFluttermoji({String fluttermojiNew = ''}) async {
if (fluttermojiNew.isEmpty) {
fluttermojiNew = getFluttermojiFromOptions();
}
SharedPreferences pref = await SharedPreferences.getInstance();
await pref.setString('fluttermoji', fluttermojiNew);
fluttermoji.value = fluttermojiNew;
await pref.setString(
'fluttermojiSelectedOptions', jsonEncode(selectedOptions));
update();
}