serialize method

String? serialize(
  1. T obj
)

serialize obj of type T for shared preferences.

Implementation

String? serialize(T obj) {
  if (customEncode == null) {
    return jsonEncode(obj);
  } else {
    return customEncode!(obj);
  }
}