onDataSourceSuccess method
Implementation
@override
Future<bool> onDataSourceSuccess(IDataSource source, Data? list) async
{
busy = true;
// build options
int i = 0;
if ((list != null))
{
// clear items
this.items.forEach((item) => item.dispose());
this.items.clear();
list.forEach((row)
{
XmlElement? prototype = S.fromPrototype(this.prototype, "${this.id}-$i");
i = i + 1;
var model = MenuItemModel.fromXml(parent, prototype, data: row);
if (model != null) items.add(model);
});
notifyListeners('list', items);
}
busy = false;
return true;
}