XmlLayout constructor
XmlLayout({
- Key? key,
- required String? template,
- Map objects = const {},
- ItemConstructor? onUnkownElement,
Constructs a XmlLayout widget
template is the xml string to build widget.
objects parameters will be pass to builder.
apply
handle the invoke from XmlLayout widget.
onUnkownElement handle unkown element
Example:
XmlLayout(
template: "<Text>$counter</Text>",
objects: {"counter": _counter},
);
Implementation
XmlLayout({Key? key,
required this.template,
this.objects = const {},
this.onUnkownElement})
: element = null,
super(key: key) {
assert(template != null);
_initialize();
}