setBlockUser static method

void setBlockUser(
  1. String contentId
)

Implementation

static void setBlockUser(String contentId) async {
  SharedPreferences pref = await SharedPreferences.getInstance();

  Preferences.getBlockUser().then((value) async {
    List<String> data = [];
    if (value != null) {
      data = value;
    }
    data.add(contentId);

    String encode = jsonEncode(data);

    await pref.setString(clubUserBlock, encode);
  });
}