TextWithImages constructor

TextWithImages(
  1. List<Object> parts
)

parts are Strings and Images, joined in order with nothing added between them.

Implementation

TextWithImages(List<Object> parts) : parts = List.unmodifiable(parts) {
  for (var i = 0; i < parts.length; i++) {
    final part = parts[i];
    if (part is! String && part is! Image) {
      throw ArgumentError(
        'must hold only Strings and Images, not ${part.runtimeType}',
        'parts[$i]',
      );
    }
  }
}