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