Widget class abstract

An HTML widget attached to a message.

In a Flutter app, prefix the Telegram import to use both Widget types: import 'package:televerse/telegram.dart' as telegram;.

Available extensions
Annotations
  • @freezed

Constructors

Widget({@JsonKey.new(name: 'html') required String html, @JsonKey.new(name: 'id') String? id, @JsonKey.new(name: 'width') int? width, @JsonKey.new(name: 'height') int? height, @JsonKey.new(name: 'public_data') String? publicData, @JsonKey.new(name: 'chat_data') String? chatData})
Creates a Widget.
const
factory
Widget.fromJson(Map<String, dynamic> json)
Creates a Widget from JSON.
factory

Properties

chatData → String?
Data specific to the message.
no setterinherited
copyWith → $WidgetCopyWith<Widget>
Create a copy of Widget with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
height → int?
Height in logical pixels, if fixed.
no setterinherited
html → String
The HTML source of the widget.
no setterinherited
id → String?
Identifier of the widget, if it is shared.
no setterinherited
publicData → String?
Data available wherever the widget is shown.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width → int?
Width in logical pixels, if fixed.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Widget value)) → TResult

Available on Widget, provided by the WidgetPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Widget value)?) → TResult?

Available on Widget, provided by the WidgetPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Widget value)?, {required TResult orElse()}) → TResult

Available on Widget, provided by the WidgetPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this Widget to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited