copyWith method

ChatMedia copyWith({
  1. String? url,
  2. ChatMediaType? type,
  3. String? fileName,
  4. int? size,
  5. String? extension,
  6. Map<String, dynamic>? metadata,
  7. Widget customBuilder(
    1. BuildContext,
    2. ChatMedia
    )?,
})

Creates a copy of this media with the given fields replaced with new values

Implementation

ChatMedia copyWith({
  String? url,
  ChatMediaType? type,
  String? fileName,
  int? size,
  String? extension,
  Map<String, dynamic>? metadata,
  Widget Function(BuildContext, ChatMedia)? customBuilder,
}) =>
    ChatMedia(
      url: url ?? this.url,
      type: type ?? this.type,
      fileName: fileName ?? this.fileName,
      size: size ?? this.size,
      extension: extension ?? this.extension,
      metadata: metadata ?? this.metadata,
      customBuilder: customBuilder ?? this.customBuilder,
    );