value property

Future<List<T>> value

Gets the value of this ApptimizeListVariable of the specified type.

Gets the default list provided at construction if no variant has been received from the servers, or the variant list if enrolled in a particular variant.

Returns the default value if there is an issue with the incoming variant data.

Implementation

Future<List<T>> get value async {
  List<dynamic> list = await Apptimize._getDynamicVariableValue(name, _type);
  if (list.isEmpty) {
    return [];
  }

  return List<T>.from(list);
}