Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riverpod_generator does not respect import aliases #3550

Closed
sgowda97 opened this issue May 16, 2024 · 1 comment
Closed

riverpod_generator does not respect import aliases #3550

sgowda97 opened this issue May 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working needs triage

Comments

@sgowda97
Copy link

sgowda97 commented May 16, 2024

I have a provider where I am importing three packages, all of which has a class with same name. I imported them with alias using 'as' prefix.

The code generator is not generating the code with the said prefix.

To Reproduce

import 'package:keyzane/model/entity/user.dart' as entity;

@riverpod
class InitStreamChat extends _$InitStreamChat {
  @override
  FutureOr<void> build(entity.User currentUser, TokenResponse tokenResponse) {}
}

abstract class _$InitStreamChat
    extends BuildlessAutoDisposeAsyncNotifier<void> {
  late final User currentUser;
  late final TokenResponse tokenResponse;

  FutureOr<void> build(
    User currentUser,
    TokenResponse tokenResponse,
  );
}

Expected behavior
Instead of late final User currentUser;, it should be late final entity.User currentUser;.

@sgowda97 sgowda97 added bug Something isn't working needs triage labels May 16, 2024
@rrousselGit
Copy link
Owner

3.0.0 improves this.

I don't plan on making further changes for this until we have macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants