Skip to content

The class 'GetIt' doesn't have a default constructor. #169

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

Closed
corporate-cas opened this issue Mar 31, 2021 · 1 comment
Closed

The class 'GetIt' doesn't have a default constructor. #169

corporate-cas opened this issue Mar 31, 2021 · 1 comment

Comments

@corporate-cas
Copy link

I get the error: "The class 'GetIt' doesn't have a default constructor." when I try to instantiate the GetIt class.

import 'package:get_it/get_it.dart';

GetIt locator = GetIt();

void setUPLocator() {
  //REGISTER SERVICES HERE...
}

The class 'GetIt' doesn't have a default constructor.
Try using one of the named constructors defined in 'GetIt'.dartnew_with_undefined_constructor_default

@escamoteur
Copy link
Collaborator

use the instance property instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants