Skip to content

Instantly share code, notes, and snippets.

Taking care of my mental health and in spare moments coding sometimes.

Samuel Matias samuelematias

Taking care of my mental health and in spare moments coding sometimes.
View GitHub Profile
samuelematias / extension_example.dart
Created Mar 12, 2020
Examples of Dart extension methods
View extension_example.dart
extension Paddings on Widget {
Widget paddingAll(double padding) => Padding(
padding: EdgeInsets.all(padding),
child: this,
extension TextStyles on Text {
Text h1() {
if (this is Text) {
View name_initial_widget.dart
import 'package:flutter/material.dart';
class NameInitialsWidget extends StatelessWidget {
final double width;
final double height;
final String text;
final double fontSize;
final double margin;
const NameInitialsWidget(
View extension.dart
extension TextExtension on Text {
Text h1({TextStyle style}) {
TextStyle defaultStyle = TextStyle(
fontFamily: 'Nunito_Sans',
fontSize: 36,
fontWeight: FontWeight.w900,
fontStyle: FontStyle.normal,
letterSpacing: -0.02,
color: SoulphiaTheme.defaultGraySwatch[50],
samuelematias / modal_with_keyboard.dart
Created May 15, 2020
Modal with keyboard Flutter
View modal_with_keyboard.dart
isScrollControlled: true,
context: context,
builder: (context) {
return SingleChildScrollView(
EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: AnyChild(),
samuelematias / launch.json
Last active Jun 10, 2020
[Flutter] Open 2 devices in debug mode on VsCode.
View launch.json
//To get your devideId follow this steps:
//1 - Open your emulator/simulator (Android/iOS/Browser)
//2 - Run on terminal "flutter devices"
//3 - Get de deviceId (second param:
// More infos:
"version": "0.2.0",
"configurations": [
"name": "Android",
samuelematias / flutter_github_ci.yml
Created Jun 22, 2020 — forked from rodydavis/flutter_github_ci.yml
Flutter Github Actions Build and Deploy Web to Firebase Hosting, iOS to Testflight, Android to Google Play (fastlane)
View flutter_github_ci.yml
name: CI
- master
- master
samuelematias /
Created Jun 23, 2020 — forked from rodydavis/
Using Fastlane for Flutter to deploy iOS, Mac, Android and Web
# This file contains the configuration
# You can find the documentation at
# For a list of all available actions, check out
# For a list of all available plugins, check out
View flutter_device_utils.dart
import 'package:flutter/foundation.dart';
import 'dart:io';
bool get isWeb => kIsWeb;
bool get isMobile => !isWeb && (Platform.isIOS || Platform.isAndroid);
bool get isDesktop =>
!isWeb && (Platform.isMacOS || Platform.isWindows || Platform.isLinux);
bool get isApple => !isWeb && (Platform.isIOS || Platform.isMacOS);
bool get isGoogle => !isWeb && (Platform.isAndroid || Platform.isFuchsia);
samuelematias / app_theme.dart
Created Jun 24, 2020
Customize/Theming the ThemeData to Light/Dark Theme
View app_theme.dart
import 'package:flutter/material.dart';
class AppTheme {
static final Color _iconColor = Colors.redAccent.shade200;
static const Color _lightPrimaryColor = Colors.white;
static const Color _lightPrimaryVariantColor = Color(0xFFE1E1E1);
static const Color _lightSecondaryColor =;
samuelematias / pre-push
Created Jul 7, 2020 — forked from rogood/pre-push
Flutter Pre Push Hook with Console Messages
View pre-push
#!/usr/bin/env bash
if [[ `git status --porcelain` ]]; then
printf "\e[31;1m%s\e[0m\n" 'This script needs to run against committed code only. Please commit or stash you changes.'
exit 1
printf "\e[33;1m%s\e[0m\n" 'Running the Flutter analyzer'
flutter analyze
if [ $? -ne 0 ]; then
printf "\e[31;1m%s\e[0m\n" 'Flutter analyzer error'
exit 1