syncModels method
dynamic
syncModels(
- String jobName,
- BuildContext context,
- Function dispatcher, [
- List<
Type> ? models,
Implementation
syncModels(String jobName, BuildContext context, Function dispatcher,
[List<Type>? models]) async {
// fix BuildContext?, List<Type>?
bool isNetworkAvilable = await SystemRF.network.hasInternet();
if (isNetworkAvilable) {
if (!Platform.isIOS) {
var inputData = Map<String, dynamic>();
if (models != null) {
for (var item in models) {
inputData[item.toString()] = item.toString();
}
}
_syncWithService(jobName, context, dispatcher,
models == null ? null : inputData); // pass table
} else {
_syncWithoutService(models!, context); // pass table
}
} else {
rf.msg(context, 'No Internet Connection');
}
}