Skip to content

Instantly share code, notes, and snippets.

@JaveedIshaq
Created April 16, 2022 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JaveedIshaq/403335bb10fb1d4d7bf992711c52ec0b to your computer and use it in GitHub Desktop.
Save JaveedIshaq/403335bb10fb1d4d7bf992711c52ec0b to your computer and use it in GitHub Desktop.
Creat Singletone pattern in dart
class LoginApi implements LoginApiProtocol {
const LoginApi._sharedInstance();
static const LoginApi _shared = LoginApi._sharedInstance();
factory LoginApi.instance() => _shared;
@override
Future<LoginHandle?> login(
{required String email, required String password}) {
throw UnimplementedError();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment