XmlLayout constructor

XmlLayout({
  1. Key? key,
  2. required String? template,
  3. Map objects = const {},
  4. 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();
}