Hi,
I am creating a data source within a viewModel in my app and am having a problem getting the notifyListeneners to trigger as I was intending.
As per the small snippet below; I am creating the sfDatagrid data-source within my view model, and all the data then exists within the sfDataGrid Datasource.
Prior to using sfDatagrid usage, I would perform all data operations in the view model and then call notifyListeners (which updates my UX fine).
Currently when data is loaded (infinite scroll load etc), the datagrid in my UX is refreshing fine - as I am calling notifyDataSourceListeners().
This call, or the additional notifyListeners() however does not trigger a change notification in my parent model.
An example could be a record count variable shown on screen for example.
I have noticed that you have an ability to addListener - and I wondered of this was intended to be used here...?
I was thinking that I could potentially listen for data changes from the view model and then call "notifyListeners" to update my UX as required..?
class SupplierViewModel extends BaseViewModel {
final APIAuthService? _ckAPIService = locator<APIAuthService>();
final MenuService? _menuService = locator<MenuService>();
// Datasources; sfDatagrid data source
SupplierDataSource supplierDataSource = SupplierDataSource();
Great product - keep up the great work...!
Kind regards
Ian.