Skip to content

Instantly share code, notes, and snippets.

View lbarqueira's full-sized avatar

Luis Barqueira lbarqueira

View GitHub Profile
import 'dart:convert';
// article - How to parde Json in Flutter
// https://www.filledstacks.com/snippet/how-to-parse-json-in-flutter/
void main() {
var jsonData = '{"name" : "Dane", "alias" : "FilledStacks"}';
print(jsonData);
var parsedJson = json.decode(jsonData);
@lbarqueira
lbarqueira / git_remove_original_remote.cmd
Last active October 6, 2020 09:59
How to commit to your own GitHub repository - first, remove the remote repository associated using git remote rm origin - https://sung.codes/blog/2017/10/01/push-git-cloned-repository-github/
C:\codevscode\network_async\Clima-Flutter>git remote -v
origin https://github.com/londonappbrewery/Clima-Flutter.git (fetch)
origin https://github.com/londonappbrewery/Clima-Flutter.git (push)
C:\codevscode\network_async\Clima-Flutter>git remote rm origin
C:\codevscode\network_async\Clima-Flutter>git remote -v
C:\codevscode\network_async\Clima-Flutter>git remote -v
origin https://github.com/lbarqueira/Clima-Flutter.git (fetch)
@lbarqueira
lbarqueira / git_example_1.cmd
Last active October 16, 2020 09:15
How to push a directory in a project, to a diferent existing repository (from the project repository, and the directory is included in .gitignore)
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\codevscode\portfolio_pwa>flutter clean
Deleting build... 4ms
C:\codevscode\portfolio_pwa>git remote -v
origin https://github.com/lbarqueira/portfolio_pwa.git (fetch)
origin https://github.com/lbarqueira/portfolio_pwa.git (push)
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'My app', // used by the OS task switcher
home: SafeArea(
child: MyScaffold(),
),
@lbarqueira
lbarqueira / 30_days_of_flutter_material_components.dart
Last active February 8, 2021 10:16
Using Material Components - https://flutter.dev/docs/development/ui/widgets-intro#using-material-components - Flutter provides a number of widgets that help you build apps that follow Material Design. A Material app starts with the MaterialApp widget, which builds a number of useful widgets at the root of your app.
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Tutorial',
home: TutorialHome(),
),
);
@lbarqueira
lbarqueira / 30_days_of_flutter_handling_gestures.dart
Created February 8, 2021 10:58
Handling gestures - https://flutter.dev/docs/development/ui/widgets-intro#handling-gestures - Most applications include some form of user interaction with the system. The first step in building an interactive application is to detect input gestures.
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Tutorial',
home: TutorialHome(),
),
);
@lbarqueira
lbarqueira / 30_days_of_flutter_codelab_basic_layout_concepts.dart
Created February 8, 2021 13:18
Flutter layout codelab, where you learn how to build a Flutter UI without downloading and installing Flutter or Dart! Row, Column, Flexible
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Tutorial',
home: Scaffold(
body: Container(
decoration: BoxDecoration(color: Colors.cyan),
@lbarqueira
lbarqueira / 30_days_of_flutter_codelab_basic_layout_concepts_2.dart
Last active February 8, 2021 17:01
Flutter layout codelab, where you learn how to build a Flutter UI without downloading and installing Flutter or Dart! Row, Column, SizedBox, Spacer
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Tutorial',
home: Scaffold(
body: Container(
decoration: BoxDecoration(color: Colors.cyan),
@lbarqueira
lbarqueira / 30_days_of_flutter_codelab_basic_layout_concepts_3.dart
Created February 8, 2021 18:50
Flutter layout codelab, where you learn how to build a Flutter UI without downloading and installing Flutter or Dart! Row, Column, Text, Icon, Image
import 'package:flutter/material.dart';
void main() {
runApp(
MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Tutorial',
home: Scaffold(
body: Container(
decoration: BoxDecoration(color: Colors.cyan),