Skip to content

Instantly share code, notes, and snippets.

View taciomedeiros's full-sized avatar

Tacio Medeiros taciomedeiros

  • VITTA
  • Uberlândia
View GitHub Profile
@taciomedeiros
taciomedeiros / index.js
Created February 25, 2021 20:54
Gist from mistakes.io
const cardCode = '0000000000000000000000008650001144591116';
const cardCode2 = '8650001144591116';
const cardCode3 = '86500011445911160000';
const cardCode5 = '0000';
const extractCardCode= (_cardCode) => {
if(_cardCode.startsWith('00')) {
const _replaced = _cardCode.replace(/0{2,}/, '')
if(!_replaced) return true;
return `0${_replaced}`
@taciomedeiros
taciomedeiros / implicit_animation_example.dart
Created November 28, 2020 10:38
Implicit animation example
import 'dart:math';
import 'package:flutter/material.dart';
const _duration = Duration(milliseconds: 400);
double randomBorderRadius() {
return Random().nextDouble() * 64;
}
@taciomedeiros
taciomedeiros / index.js
Created November 19, 2020 11:27
Gist from mistakes.io
const regex = /[a-z|A-Z|\s|\+]+[^\s\d|^\s-]/;
regex.exec('CLORIDRATO DE SERTRALINA 50 MG (G)')
regex.exec('AVAMYS - 27,5 MCG/DOSE - Suspensão nasal')
regex.exec('CLORIDRATO DE SERTRALINA 50 MG (G)')
regex.exec('CLORIDRATO DE SERTRALINA 50 MG (G)')
regex.exec('ADDERA D3 50000 UI - Cápsula')
regex.exec('AVAMYS 27,5 MCG/DOSE - Suspensão nasal')
regex.exec('SUMAX 50 MG - Comprimido 50 MG - Comprimido')
regex.exec('NAPROXENO 500 MG - Comprimido 500 MG - Comprimido')
@taciomedeiros
taciomedeiros / isolate_handler_example.dart
Created August 16, 2020 12:11
It is an example of how to use flutterLocalnotifications to schedule a lot of notifications with isolateHandler
final IsolateHandler isolateHandler = IsolateHandler();
void scheduleNotificationsIsolate(String _reminders) async {
await new Future.delayed(new Duration(milliseconds: 500));
// ... (describe settings)
flutterLocalNotificationsPlugin.initialize(
settings,
onSelectNotification: onSelectNotification,
);

Clean architecture aplicada a um aplicativo Flutter

Camadas

project_layers

Domain

A camada domain provê as regras e as unidades de negócio usadas na aplicação. Nesta camada estão os Services que são consumidos pelos BLoCs/PageControllers da camada app, as Entities e os contratos dos repositórios de dados, cuja implementação concreta fica na camada data.