rename method

Future<ProductList> rename(
  1. ProductList initialList,
  2. String newName
)

Implementation

Future<ProductList> rename(
  ProductList initialList,
  String newName,
) async {
  final ProductList newList = ProductList.user(newName);
  final _BarcodeList list =
      await _get(initialList) ?? _BarcodeList.now(<String>[]);
  await _put(getKey(newList), list);
  await delete(initialList);
  await get(newList);
  return newList;
}