getValue<T> abstract method

T? getValue<T>(
  1. String key, {
  2. T? defaultValue,
})

Method to get custom object value from the storage, if the retrieved value is null then defaultValue should be used, if provided.

Example code(SharedPreferences Implementation): /// ```dart T? getValue


T - Represents any valid class or primitive types supported by flutter

The [defaultValue] is an optional & nullable value, you may choose not to provide it
in which case the null value will be returned as result.

Output can be represented like this:
 getterOutput -if-absent-> defaultValue -if-absent-> null

here [getterOutput] is the expected output of the getter method called.
The method must be implementation of one of the definitions from the cache provider

Implementation

T? getValue<T>(String key, {T? defaultValue});