The result should be the error message. Returning null indicates that the callback succeed.
typedef LoginCallback = Future<String?> Function(LoginData loginData);