FLUTTER ECOSYSTEM

Aksoyhlc/github_signin_aksoyhlc

Este pacote foi feito para facilitar o processo de adicionar login/cadastro do GitHub em aplicativos Flutter. Usa a API OAuth oficial do GitHub.

Capa do projeto github_signin_aksoyhlc
Stars
1
Forks
3
Último push (UTC)
7 de set. de 2025
Status do projeto
Ativo
Ökkeş Aksoy GitHub avatar
GITHUB User

Ökkeş Aksoy ↗

AksoyhlcTurkeySite oficial ↗
LinguagensDartSwiftHTMLKotlinObjective-C

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 5 itens

README original

Texto original em inglês. Visite o GitHub para a versão atual.

Expandir / recolher README

Getting Started

Add package dependency

github_signin_aksoyhlc: any  

Example 1

	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  
	}  

Example 2

	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  
Custom AppBar
	GithubSignIn(
		params: params,
		appBar: PreferredSize(
			child: AppBar(
  				title: Text("Github Sign In"),
			),
			preferredSize: const Size.fromHeight(56),
		)
	)