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/material.dart'; | |
class AppCheckbox extends StatelessWidget { | |
final String label; | |
final bool value; | |
final ValueChanged<bool> onChanged; | |
final TextStyle labelStyle; | |
const AppCheckbox( | |
{Key key, this.label, this.value, this.onChanged, this.labelStyle}) |
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
final RegExp email = RegExp( | |
r"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]" | |
r"{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a" | |
r"-zA-Z0-9])?)*$", | |
caseSensitive: false, | |
multiLine: false); | |
final RegExp mobileBrazilianPhone = RegExp(r"^\(?0?\d{2}\)? ?9 ?\d{4}-?\d{4}$", | |
caseSensitive: false, multiLine: false); |
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/material.dart'; | |
class AppTextFormField extends StatefulWidget { | |
final String textLabel; | |
final double fontSize; | |
final Color textColor; | |
final Color backgroundColor; | |
final Color shadowColor; | |
final TextEditingController controller; | |
final FocusNode focusNode; |
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 com.google.firebase.database.* | |
import com.linkaberto.aproveitafrete.aproveitafrete.data.repositorio.RepoSingleton | |
import com.linkaberto.aproveitafrete.aproveitafrete.model.Anuncio | |
import info.marcussoftware.mschat.interfaces.Message | |
import io.reactivex.Observable | |
import io.reactivex.subjects.BehaviorSubject | |
import io.reactivex.subjects.PublishSubject | |
/** | |
* Created by Marcus Eduardo - [email protected] on 12/02/2018. |
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
main(){ | |
var marcusFala = pessoaFala("Marcus"); | |
print(marcusFala("É muito legal uma função retornar outra função")); | |
var claudioFala = pessoaFala("Claudio"); | |
print(claudioFala("Você só fica pronto fazendo!")); | |
} | |
Function pessoaFala(String nome) => (String msg) => "$nome: $msg"; |
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
main(){ | |
funcaoParametroPosicionadoOpcional("Eu gosto de Video Games!",'Raul'); | |
funcaoParametroPosicionadoOpcional('As vezes sonho que estou caindo e acordo assustado', | |
'Eu Sonhando', 2); | |
funcaoParametroPosicionadoOpcional("Você aqui de novo?"); | |
} | |
void funcaoParametroPosicionadoOpcional(String msg, | |
[String sujeito = "Nameless King", | |
int repetirXVezes=1]){ |
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
main(){ | |
exemploParametroNomeadoOpcional("Olá viajante!"); | |
exemploParametroNomeadoOpcional("Olá undead!", sujeito: "Crestfallen Warrior"); | |
} | |
void exemploParametroNomeadoOpcional(String msg/*Parâmetro obrigatorio*/, | |
{String sujeito/*Parâmetro opcional*/}){ | |
print('$sujeito: $msg'); | |
} |
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
main(){ | |
//Vai compilar | |
dynamic numero = 10; | |
print('Agora a variavel numero é um ${numero.runtimeType} e possui o valor "$numero"'); | |
//Agora vai compilar | |
numero = "Dez"; | |
print('Agora a variavel numero é um ${numero.runtimeType} e possui o valor "$numero"'); | |
//Vai lançar uma exceção em tempo de execução | |
int resultadoSoma = 19 + numero; | |
print('"Dez" + 19 = $resultadoSoma'); |
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 'dart:math'; | |
void main() { | |
sorteio(); | |
sorteio(); | |
sorteio(); | |
sorteio(); | |
sorteio(); | |
sorteio(); | |
} |