You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I make use of FlutterFire Firebase Authentication. This package declares a model User which clashes with my own User model. Therefore I import Firebase Authentication namespaced: import 'package:firebase_auth/firebase_auth.dart' as firebase_auth;. I have a model AuthenticationState which looks as follows:
@CopyWith()
class AuthenticationState {
AuthenticationState({
required this.user,
this.firebaseUser,
});
final User user;
final firebase_auth.User? firebaseUser;
}
CopyWith however doesn't take the namespace in account and sees both properties as User. I also tried defining a typedef typedef FirebaseUser = firebase_auth.User; and use that, but CopyWith then still types firebaseUser as User which resolves to my own User model.
Environment details
➜ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on macOS 12.3.1 21E258 darwin-x64, locale en-NL)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.66.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!
➜ flutter --version
Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5464c5bac7 (3 days ago) • 2022-04-18 09:55:37 -0700
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2
Seeing a similar thing happen with a field that has been typedefed to another (imported) class. It seems to not use the typedef name, and also doesn't import the underlying source file.
This is also causing problems for me, since I have a class that uses two libraries that have classes with the same name, so obviously i have to import as at least one of them, but since this extension doesn't recognise namespaced imports, it fails.
Describe the issue
I make use of FlutterFire Firebase Authentication. This package declares a model
User
which clashes with my ownUser
model. Therefore I import Firebase Authentication namespaced:import 'package:firebase_auth/firebase_auth.dart' as firebase_auth;
. I have a modelAuthenticationState
which looks as follows:CopyWith however doesn't take the namespace in account and sees both properties as
User
. I also tried defining a typedeftypedef FirebaseUser = firebase_auth.User;
and use that, but CopyWith then still typesfirebaseUser
asUser
which resolves to my ownUser
model.Environment details
Paste the package version.
To Reproduce
I think the issue is clear.
Expected behaviour
I think the issue is clear.
Additional context
Let me know what you need :-)
The text was updated successfully, but these errors were encountered: