This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onPressed: () { | |
Navigator.pushNamed(context, UsuarioAddPage.routeName); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
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'), | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
/// Arquivo gerado via manager do Django para controlar as rotas nomeadas | |
/// da aplicação. | |
/// | |
/// Caso uma nova app seja adicionada no projeto siga os passos abaixo: | |
/// 1. Adicionar as constantes nas páginas: | |
/// 1.1 Index -> static const routeNameIndexPage = "/xptoIndex"; | |
/// 1.2 List -> static const routeNameListPage = "/xptoListPage"; | |
/// 1.3 Create -> static const routeNameAddPage = "/xptoAddPage"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FeedCardView extends StatefulWidget { | |
final PostModel post; | |
final UserModel user; | |
final UserModel loggedUser; | |
final double elevation; | |
final double topLeft; | |
final double topRight; | |
final double bottomRight; | |
final double bottomLeft; | |
final Color bgColor; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return Observer( | |
builder: (context) { | |
if (_feedController.processing == true) { | |
return customCupertinoActivity(context); | |
} else if (_feedController.errorMessage.isNotEmpty) { | |
return Center( | |
child: Text(_feedController.errorMessage), | |
); | |
} else { | |
if (_feedController.list != null) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestProfissional: | |
@pytest.fixture | |
def init(self, db): | |
self.nome = "Xpto" | |
self.group = Group.objects.create(name="Profissional") | |
self.faker = Faker("pt_BR") | |
def test_update_pontuacao(self, init): | |
assert self.nome == "Xpto" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@pytest.mark.django_db | |
class TestProfissional: | |
def test_update_pontuacao(db): | |
Group.objects.create(name="Profissional") | |
faker = Faker("pt_BR") | |
profissional = Profissional.objects.create( | |
cpf=CPF().generate(), | |
nome = faker.name(), | |
email = f"{faker.name().lower()}@{faker.free_email_domain()}", | |
telefone = faker.phone_number() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AgendamentoSerializer(FieldsListSerializerMixin, ModelSerializer): | |
fk_profissional = ProfissionalSerializer(read_only=True) | |
fk_cliente = ClienteSerializer(read_only=True) | |
fk_servico = ServicoSerializer(read_only=True) | |
etapa_display = CharField(source="get_etapa_display", read_only=True, allow_null=True, allow_blank=True) | |
class Meta: | |
model = Agendamento |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PessoaCubit extends Cubit<PessoaState> { | |
PessoaService _service; | |
List<PessoaModel> pessoaList; | |
List<PessoaModel> pessoaDestaqueList; | |
PessoaCubit() : super(PessoaInitial()) { | |
_service = PessoaService(); | |
} |