Skip to content

Instantly share code, notes, and snippets.

View valterh4ck3r's full-sized avatar
🏠
Working from home

Valter Negreiros valterh4ck3r

🏠
Working from home
View GitHub Profile
@valterh4ck3r
valterh4ck3r / command.sh
Created March 10, 2020 18:56
Show Folder Size
du -sh directory_name
du -sh *
@valterh4ck3r
valterh4ck3r / mask_brl.dart
Last active March 31, 2021 15:32
Flutter Value Text to BRL (Real)
import 'package:flutter_masked_text/flutter_masked_text.dart';
class MaskUtil{
static MoneyMaskedTextController mask = MoneyMaskedTextController(decimalSeparator: ',', thousandSeparator: '.');
static String textToBRL(String value){
mask.text = value;
return mask.text;
}
@valterh4ck3r
valterh4ck3r / rounded_text_field.dart
Last active November 8, 2019 20:20
Rounded Text Field Example
Container(
width: MediaQuery.of(context).size.width / 1.2,
height: 70,
child: TextField(
decoration: InputDecoration(
border: OutlineInputBorder(
borderRadius: BorderRadius.all(
Radius.circular(40),
),
borderSide: BorderSide(width: 2)
@valterh4ck3r
valterh4ck3r / validate_email.dart
Created November 8, 2019 05:02
Validate Email Flutter
static bool isEmail(String em) {
String p = r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
RegExp regExp = new RegExp(p);
return regExp.hasMatch(em);
}
@valterh4ck3r
valterh4ck3r / run-mongo-terminal.sh
Created October 16, 2019 19:16
How to Run MongoDB Locally - MacOS
~/mongodb/bin/mongo
@valterh4ck3r
valterh4ck3r / torre_martirio.md
Last active October 9, 2019 04:08
Guia da Torre do Martírio

Torre do Martírio

Requisitos

Nível 89+, Cultivo God/Evil

Equipamentos Recomendados

Arma com Nível de Matança (Arma do 85, 95 ou 101)

@valterh4ck3r
valterh4ck3r / configure_notification.dart
Last active August 19, 2020 19:17
How to implement notification in flutter
_configureNotification(){
FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
_firebaseMessaging.configure(
onMessage: (Map<String, dynamic> message) async {
print("onMessage");
print(message);
if(Platform.isIOS){
if(message["aps"] != null){
NotificationService.showNotification(message["aps"]["alert"]["title"],
message["aps"]["alert"]["body"]);
@valterh4ck3r
valterh4ck3r / rounded_button.dart
Created September 9, 2019 17:04
Rounded Button Flutter
import 'package:flutter/material.dart';
class RoundedButton extends StatelessWidget {
final String buttonName;
final VoidCallback onTap;
final double height;
final double width;
final double bottomMargin;
@valterh4ck3r
valterh4ck3r / app.dart
Created August 12, 2019 20:28
Change Navigation Bar Color Flutter
var mySystemTheme = SystemUiOverlayStyle.dark
.copyWith(systemNavigationBarColor: Colors.red);
SystemChrome.setSystemUIOverlayStyle(mySystemTheme);
return MaterialApp(
debugShowCheckedModeBanner: false,
home: InitScreen(),
);
@valterh4ck3r
valterh4ck3r / MainActivity.kt
Created August 12, 2019 17:44
Facebook MainActivity Flutter Kotlin
package com.dvitsolutions.staffdoc
import android.os.Bundle
import io.flutter.app.FlutterActivity
import io.flutter.plugins.GeneratedPluginRegistrant
import com.facebook.FacebookSdk;
import androidx.multidex.MultiDex;
import com.google.android.gms.common.util.IOUtils.toByteArray
import android.content.pm.PackageManager