hasUserId method
Checks if a user ID has been generated for this device.
Returns true if a user ID exists in storage, false if this
is the first time the service is being used on this device.
This method is useful for analytics or onboarding flows where you need to distinguish between new and returning users.
Example:
if (await userService.hasUserId()) {
print('Welcome back!');
} else {
print('Welcome to CulicidaeLab!');
}
Implementation
Future<bool> hasUserId() async {
return _prefs.containsKey(_userIdKey);
}