onDataSourceSuccess method
Implementation
@override
Future<bool> onDataSourceSuccess(IDataSource source, Data? list) async {
busy = true;
// save pointer to data source
myDataSource = source;
// clear items
for (var tab in tabs) {
tab.dispose();
}
tabs.clear();
// set data
data = list ?? Data();
// build tabs
for (var d in data) {
// scoped tab model
var model = TabModel.fromXml(this, prototype, scoped: true, data: d);
if (model != null) {
tabs.add(model);
}
}
// notify listeners
notifyListeners('tabs', tabs);
busy = false;
return true;
}