Skip to content

Instantly share code, notes, and snippets.

View marcos-bah's full-sized avatar
🇧🇷
Working from home

Marcos Barbosa marcos-bah

🇧🇷
Working from home
View GitHub Profile
@marcos-bah
marcos-bah / settings.grandle
Last active June 10, 2020 15:36
Resolução para: [firebase_core_web , firebase_auth_web, cloud_firestore_web ] Plugin project :firebase_auth_web not found. Please update settings.gradle.
// app -> android -> settings.gradle
// Please add this in flutte
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}
@marcos-bah
marcos-bah / build.gradle
Last active June 10, 2020 15:36
Erro de conexão com o firebase console.
// path = android/app/build.gradle
// add this line in android { defaultConfig { <here> } }
multiDexEnabled true
@marcos-bah
marcos-bah / keytool
Created June 16, 2020 20:20
Comando para gerar chave SHA1 para Firebase
// Esteja no diretorio que contenha o keytool ou o defina globalmente
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
@marcos-bah
marcos-bah / gitHubSignIn.dart
Last active June 18, 2020 13:15
SignIn com GitHub
final GitHubSignIn gitHubSignIn = GitHubSignIn(
clientId: "<ClientId>",
clientSecret:
"<ClientSecret>",
redirectUrl:
"<CallBack>");
var result = await gitHubSignIn.signIn(context);
switch (result.status) {
case GitHubSignInResultStatus.ok:
print(result.token);
@marcos-bah
marcos-bah / size_config.dart
Created June 18, 2020 13:44
Classe para posicionar elementos no Flutter
import 'package:flutter/widgets.dart';
class SizeConfig {
static MediaQueryData _mediaQueryData;
static double screenWidth;
static double screenHeight;
static double blockSizeHorizontal;
static double blockSizeVertical;
static double _safeAreaHorizontal;
static double _safeAreaVertical;
@marcos-bah
marcos-bah / gitHubSignInFull.dart
Created June 18, 2020 14:20
GithHubSignIn Completo
final GitHubSignIn gitHubSignIn = GitHubSignIn(
clientId: "",
clientSecret:
"",
redirectUrl:
"");
var result = await gitHubSignIn.signIn(context);
switch (result.status) {
case GitHubSignInResultStatus.ok:
final AuthCredential credential =
@marcos-bah
marcos-bah / token.dart
Created November 11, 2020 13:23
Get token with Firebase Auth
FirebaseAuth.instance.currentUser.getIdToken();
@marcos-bah
marcos-bah / insert_calendar.dart
Last active November 18, 2020 13:21
code below
//inserir evento
Future<dynamic> insertEvent(CalendarStore calendarStore) async {
Map<String, String> eventData;
String calendarId;
v3.Event event = v3.Event();
event.summary = calendarStore.title;
event.description = calendarStore.description;

$ dart create -t console-full cli

   
$ cd cli         
$ dart run