'The class 'User' doesn't have an unnamed constructor. Try using one of the named constructors defined in 'User'

import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';

class AuthMethods {
  final FirebaseAuth _auth = FirebaseAuth.instance;
  User? _userFromUser(User user) {
    return user != null ? User(userId: user.uid) : null;
  }

It used to work, this block of code is not working now, where am I going wrong? please help me



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source