deletestObjectfForList method

Future<bool> deletestObjectfForList(
  1. String newObject,
  2. String keyList,
  3. int indexObjetc
)

Implementation

Future<bool> deletestObjectfForList(
    String newObject, String keyList, int indexObjetc) async {
  final sharedPrefs = await _instance;
  if (sharedPrefs.preferences.containsKey(keyList)) {
    List<String> oldList = await loadListObject(keyList);
    oldList.removeAt(indexObjetc);
    sharedPrefs.preferences.setStringList(keyList, oldList);
    return true;
  }
  return false;
}