I have 2 sorted arrays of application names in the user's Android device. I now need to log an event if one array contains at least one item of the other array.
Here is my code:
appsArray = ["cred","cult","hotstar","netflix","prime","splitwise","spotify"];
_apps = [...]; // Apps in user's mobile
bool _isQualityUser() {
var result = '';
for (var app in _apps) {
result = appsArray.singleWhere((el) => app.appName.contains(el));
}
return result.isNotEmpty;
}
I'm looking for an optimized solution for it. If anyone can help with that.