Skip to content

Instantly share code, notes, and snippets.

Avatar

Guilherme de Carvalho Carneiro guilhermecarvalhocarneiro

  • Palmas, Tocantins, Brasil
View GitHub Profile
@guilhermecarvalhocarneiro
guilhermecarvalhocarneiro / auth.dart
Created May 28, 2021
Código de autenticação Apple
View auth.dart
/// Pacote Utilizado: sign_in_with_apple [https://pub.dev/packages/sign_in_with_apple]
final appleIdCredential = await SignInWithApple.getAppleIDCredential(
scopes: [
AppleIDAuthorizationScopes.email,
AppleIDAuthorizationScopes.fullName,
],
);
final oAuthProvider = OAuthProvider('apple.com');
final credential = oAuthProvider.credential(
idToken: appleIdCredential.identityToken,
View Auth.dart
/// Local Data do model Auth
///
/// Os Métodos padrões gerados são:
/// fecthAll() -> Recupera a lista de Auth.
/// save() -> Salva os dados de uma instância do Auth.
/// detail() -> Recupera os detalhes de Auth.
/// update() -> Atualiza os dados de uma instância do Auth.
/// delete() -> Deleta um registro.
/// deleteAll() -> Deleta todos os registros.
View Podfile
# Uncomment this line to define a global platform for your project
platform :ios, '14.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
View Erro ao tentar executar o projeto no emulador iOS
Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart:1
CocoaPods' output:
Preparing
Analyzing dependencies
Inspecting targets to integrate
Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)
Finding Podfile changes
R Flutter
View erro autenticação OTP
D/ViewRootImpl@30da28e[MainActivity]( 5049): ViewPostIme pointer 0
D/ViewRootImpl@30da28e[MainActivity]( 5049): ViewPostIme pointer 1
E/zzf ( 5049): Problem retrieving SafetyNet Token: 7:
W/ActivityThread( 5049): handleWindowVisibility: no activity for token android.os.BinderProxy@ff86c67
D/PhoneWindow( 5049): forceLight changed to true [] from com.android.internal.policy.PhoneWindow.updateForceLightNavigationBar:4238 com.android.internal.policy.DecorView.updateColorViews:1510 com.android.internal.policy.PhoneWindow.dispatchWindowAttributesChanged:3216 android.view.Window.setFlags:1148 com.android.internal.policy.PhoneWindow.generateLayout:2444
I/MultiWindowDecorSupport( 5049): updateCaptionType >> DecorView@260952d[], isFloating: false, isApplication: true, hasWindowDecorCaption: false, hasWindowControllerCallback: true
D/MultiWindowDecorSupport( 5049): setCaptionType = 0, DecorView = DecorView@260952d[]
W/m.example.oral( 5049): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (g
View Autenticacao via OTP
Future<void> signUpWithOTP() async {
try {
setState(() {
_isProcessing = true;
});
var phoneNumber = "+55 ${_phoneOTPController.text.trim()}";
var verifyPhoneNumber = firebaseAuth.verifyPhoneNumber(
phoneNumber: phoneNumber,
verificationCompleted: (phoneAuthCredential) async {
final _signInWithCredential = await firebaseAuth.signInWithCredential(phoneAuthCredential);
View Cupom Usuario Cupom api_views
from drf_jsonmask.views import OptimizedQuerySetMixin
from rest_framework import filters
from rest_framework.viewsets import ModelViewSet, ReadOnlyModelViewSet
from datetime import date
from .models import Cupom, UsuarioCupom
from .serializers import CupomSerializer, UsuarioCupomGETSerializer, CupomGETSerializer, UsuarioCupomSerializer
class CupomViewAPI(ModelViewSet):
""" Classe para gerenciar as requisições da API para os métodos POST, PUT, PATCH e DELETE """
View Modelos de Cupom e Cupom Usuario
from django.db import models
from nuvols.core.models import Base
from django.db.models.signals import pre_save
from django.dispatch import receiver
import hashlib
import hmac
import datetime
class Cupom(Base):
View onpressed.dart
onPressed: () {
Navigator.pushNamed(context, UsuarioAddPage.routeName);
},
View main,dart
...
return MaterialApp(
title: Config.app_title,
theme: context.watch<SettingsCubit>().lightTheme == true ? CustomTheme.lightTheme : CustomTheme.darkTheme,
home: MyHomePage(title: '${Config.app_title}'),
onGenerateRoute: RouteGenerator.generateRoute,
supportedLocales: [
const Locale('en', 'US'),
const Locale('pt', 'BR'),
],