v0.0.4
github_signin_aksoyhlc
此包旨在帮助 Flutter 开发者更轻松地在其应用程序中添加 GitHub 登录/注册功能。使用官方 GitHub OAuth API。
3喜欢 30近 30 天下载150Pub 分数
AndroidiOSWebmacOSWindows
此包旨在帮助 Flutter 开发者更轻松地在其应用程序中添加 GitHub 登录/注册功能。使用官方 GitHub OAuth API。
{"sdk":"flutter"}^6.1.5^1.5.0{"sdk":"flutter"}^6.0.0以下为英文项目原文快照,最新内容请访问 GitHub。
Add package dependency
github_signin_aksoyhlc: any
var params = GithubParamsModel(
clientId: 'xxxxxx',
clientSecret: 'yyyyyy',
callbackUrl: 'http://example.com',
scopes: 'read:user,user:email',
);
GithubSignInResponse result = await GithubSignIn.signIn(context, params: params);
if (result.status != ResultStatus.success) {
// handle error
print(result.message);
} else {
///TODO: use result
}
var params = GithubParamsModel(
clientId: 'xxxxxx',
clientSecret: 'yyyyyy',
callbackUrl: 'http://example.com',
scopes: 'read:user,user:email',
);
dynamic result = Navigator.push(context, MaterialPageRoute(builder: (context) => GithubSignIn(params: params)));
if (result == null) {
// user cancelled the sign in or error occurred
}
var data = result as GithubSignInResponse;
if (data.status != ResultStatus.success) {
print(result.message);
}
///TODO: use response data
GithubSignIn(
params: params,
appBar: PreferredSize(
child: AppBar(
title: Text("Github Sign In"),
),
preferredSize: const Size.fromHeight(56),
)
)