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
#Discard local changes | |
git reset --hard | |
#Many operations separate by ; (semicolon) | |
$ git --version; git branch | |
#Set alias to commands to access faster | |
$ git config --global alias.<alias-command> '<git command>' | |
$ git <alias-command> |
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
_startFilePicker() async { | |
InputElement uploadInput = FileUploadInputElement(); | |
uploadInput.accept = '.csv'; | |
uploadInput.click(); | |
uploadInput.onChange.listen((e) { | |
// read file content as dataURL | |
final files = uploadInput.files; | |
if (files.length == 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
//Source: https://stackoverflow.com/questions/58248277/how-to-specify-a-port-number-while-running-flutter-web | |
//Go to root project create .vscode > launch.json and then put the following code | |
//In web server | |
{ | |
"version": "0.2.0", | |
"configurations": [{ | |
"name": "Flutter", | |
"request": "launch", | |
"type": "dart", |
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
// Let's say we want our cat name to be null | |
// For that, we add ? after the String type | |
String? name = getCatName(); | |
// Use ?. instead of . with a nullable variable | |
print('${name?.length}'); | |
// Note: the Cat constructor should allow a nullable name | |
final cat = Cat(name); | |
// Let's say the Cat constructor doesn't allow a nullable name |
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 CircularProgressCustom extends StatelessWidget { | |
final Color color; | |
const CircularProgressCustom({this.color = Colors.blue}); | |
@override | |
Widget build(BuildContext context) => Center( |
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
/// Takes a list of two numbers of some num-derived type [T]. | |
T sumPair<T extends num>(List<T> items) { | |
return items[0] + items[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
https://www.mit.edu/afs.new/sipb/user/ssen/src/curl-7.11.1/docs/curl.html More info about the commands | |
$ curl --help | |
Usage: curl [options...] <url> | |
--abstract-unix-socket <path> Connect via abstract Unix domain socket | |
--alt-svc <file name> Enable alt-svc with this cache file | |
--anyauth Pick any authentication method | |
-a, --append Append to target file when uploading | |
--basic Use HTTP Basic Authentication | |
--cacert <file> CA certificate to verify peer against | |
--capath <dir> CA directory to verify peer against |
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/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'dart:io' show Platform; | |
///This dialog is for informationb | |
///(This widget returns an Alert to specify plattform) | |
class AlertPlatform extends StatelessWidget { | |
final String title, description, textPositive, textNegative; | |
final Widget content; |
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'; | |
///Default to vertical | |
class Space extends StatelessWidget { | |
final double space; | |
final bool isHorizontal; | |
const Space(this.space, {this.isHorizontal = false}); | |
@override |