add static method

dynamic add({
  1. required String customerID,
  2. void onAdd(
    1. dynamic data
    )?,
})

Implementation

static add(
    {required String customerID, void Function(dynamic data)? onAdd}) async {
  SharedPreferences share = await SharedPreferences.getInstance();
  await share
      .setString('customerId', customerID)
      .then((value) => onAdd?.call(value));
}