Skip to content

Instantly share code, notes, and snippets.

View guilhermecarvalhocarneiro's full-sized avatar

Guilherme de Carvalho Carneiro guilhermecarvalhocarneiro

  • Palmas, Tocantins, Brasil
View GitHub Profile
class PacienteDetailPage extends StatefulWidget {
static const routeName = "/pacienteDetailPage";
final PacienteModel pacienteModel;
const PacienteDetailPage({required Key key, required this.pacienteModel})
: super(key: key);
@override
_PacienteDetailPageState createState() => _PacienteDetailPageState();
main() {
var data = [
{
"long_name": "77021-654",
"short_name": "77021-654",
"types": ["postal_code"]
},
{
"long_name": "Quadra 502 Sul Avenida Joaquim Teotônio Segurado",
"short_name": "Q. 502 Sul Avenida Joaquim Teotônio Segurado",
/// O erro retornado é:
/// No implementation found for method getStorageDirectory on channel plugins.flutter.io/path_provider
Future<smbt.Database> initDb() async {
try {
final dir = await getApplicationDocumentsDirectory();
await dir.create(recursive: true);
final dbPath = join(dir.path, 'xpto.db');
return await smbt_io.databaseFactoryIo.openDatabase(dbPath);
} catch (error, exception) {
@guilhermecarvalhocarneiro
guilhermecarvalhocarneiro / auth.dart
Created May 28, 2021 19:21
Código de autenticação Apple
/// 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,
/// 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.
# 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,
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
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
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);
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 """