1

Trying to set up Anonymous sign in option from an old example it seems. Did Google change something? I'm getting error: Undefined class 'AuthResult'. Try changing the name to the name of an existing class, or creating a class with the name 'AuthResult'.

class AuthService {
  final FirebaseAuth _auth = FirebaseAuth.instance;
  
  Future signInAnonymously() async {
    try {
      AuthResult result = await _auth.signInAnonymously();
      User user = result.user;
      return user;
    } catch (e) {
      print(e.toString());
      return null;
    }
  }
}
Roman Klym
  • 149
  • 1
  • 8
  • You don't have any import statements. How would we be able to tell if AuthResult indeed exists in your code? Version info also critical. See [how to ask](http://stackoverflow.com/help/how-to-ask) and [creating an mcve](http://stackoverflow.com/help/mcve). – Kato Aug 24 '20 at 19:44

0 Answers0