-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into nikhilkalburgi-patch-1
- Loading branch information
Showing
20 changed files
with
1,050 additions
and
37 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
|
||
|
||
#Allow Flexbox display | ||
display: flex; | ||
|
||
#Align items horizontally | ||
justify-content: | ||
#Options include: | ||
flex-start; - items align to left of container | ||
flex-end; - items align to right of container | ||
center; - items align at center of container | ||
space-between; - equal spacing between items, with first at start and final at end | ||
space-around; - equal spacing around items | ||
space-evenly; - even spacing around items with a full space at either end | ||
|
||
#Align items vertically | ||
align-items: | ||
#Options include: | ||
flex-start; - items align to top of container | ||
flex-end; - items align to bottom of container | ||
center; - items align to vertical center of container | ||
baseline; - items align to baseline of container | ||
stretch; - items stretched to fit | ||
|
||
#Change direction | ||
flex-direction: | ||
#Options include: | ||
row; - items placed the same as text direction | ||
row-reverse; - items placed opposite to text direction | ||
column; - items are placed top to bottom | ||
column-reverse: items are placed bottom to top | ||
|
||
#Align specific item | ||
align-self: | ||
#Options include same values as 'align-items' but for a specific item | ||
#Overrides 'align-items' | ||
|
||
#Wrap items | ||
flex-wrap: | ||
#Options include: | ||
nowrap: every items is fit to a single line | ||
wrap: items wrap around to additional lines | ||
wrap-reverse: items wrap around to additional lines in reverse | ||
|
||
#Combination of direction and wrap | ||
flex-flow: | ||
#Options include: | ||
row wrap; - sets rows and wraps them | ||
row nowrap; | ||
row reverse nowrap; | ||
column reverse; | ||
column wrap-reverse | ||
column wrap | ||
|
||
#Space multiple lines a certain way | ||
align-content: | ||
#Options include: | ||
flex-start; - lines packed at top of container | ||
flex-end; - lines packed at bottom of container | ||
center; lines packed at vertical center of container | ||
space-between: lines display with equal spacing between them | ||
space-around: lines display with equal spacing around them | ||
stretch: lines are stretched to fit the container | ||
|
||
#Order items | ||
order: | ||
#Can be positive or negative. Default order value of 0. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# Flutter | ||
|
||
CheatSheet | ||
|
||
# confirm if your flutter SDK is set up correctly and compatible with other platforms, devices and IDE. | ||
`flutter doctor` or `flutter doctor -v` | ||
|
||
|
||
# create a new flutter project from terminal | ||
`flutter create NAME_OF_APP` | ||
|
||
# create a new flutter project and replace the default package name flutter gives you com.example.myappname | ||
`flutter create –org com.mywebsite NAME_OF_APP` | ||
|
||
|
||
# set a specific language for the Android app and iOS; here we use Java for Android and objective-C for iOS | ||
`flutter create --org=com.mywebsite --android-language=java --ios-language=objc NAME_OF_APP` | ||
|
||
|
||
# mistakenly deleted a file, create it with its boilerplate codes. This will replace all missing files without creating everything from scratch | ||
`flutter create --no-overwrite --org=com.mywebsite.NAME_OF_APP` | ||
|
||
|
||
# list all devices connected and supported by the Flutter SDK | ||
`flutter devices` | ||
|
||
# get current device id | ||
`flutter --device-id` | ||
|
||
|
||
# flutter help | ||
`flutter -h` | ||
|
||
|
||
# run a flutter app | ||
`flutter run` | ||
|
||
|
||
# to see more outputs while app is trying to build in debug mode | ||
`flutter run -v ` | ||
|
||
|
||
# after making stateless change(changing font size, color, widget size, shape, etc) | ||
`Hot Reload (r): tap small r while app is running` | ||
|
||
|
||
# after you make changes to class instances or things that will affect app’s current state | ||
`Hot Restart(R): tap big R while app is running` | ||
|
||
|
||
# take a screenshot from the terminal: | ||
`tap small (s) when running the app in debug mode` | ||
|
||
|
||
# lost connecting while debugging, connect your app back via | ||
`flutter attach -d <target-platform-name` or simply `flutter attach` | ||
|
||
|
||
# show all available options while your app is running in debug mode: | ||
`press small (h)` | ||
|
||
|
||
# list flutter channels. | ||
`flutter channel` | ||
|
||
|
||
# switch to a flutter channel | ||
`flutter channel CHANNEL_NAME` | ||
|
||
|
||
# upgrade your Flutter SDK with Dart | ||
`flutter upgrade` | ||
|
||
|
||
# get current flutter version | ||
`flutter --version` | ||
|
||
|
||
# list, launch or create emulators | ||
`flutter emulators` | ||
|
||
|
||
# generate localizations for the Flutter project | ||
`flutter gen-l10n PATH_TO_TRANSLATION_FILE` | ||
|
||
|
||
# format a dart file | ||
`flutter format PATH_TO_DART_FILE` | ||
|
||
|
||
# run your tests packages | ||
`flutter test PATH_TO_TEST_FILE` | ||
|
||
# add a third party package | ||
`flutter pub add NAME_OF_PACKAGE` | ||
|
||
|
||
# download the third party package | ||
`flutter pub get` | ||
|
||
# remove every temporary files & folders | ||
`flutter clean` | ||
|
||
|
||
# build the APK file | ||
`flutter build apk` | ||
|
||
|
||
#Tip: speed up Flutter Development | ||
use the third packages to suit your needs. Google first. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
JavaScript: | ||
|
||
# Declare a variable using let or const. | ||
let myVariable = 'hello'; | ||
const myConstant = 42; | ||
|
||
# Log a message to the console. | ||
console.log('Hello, world!'); | ||
|
||
# Alert a message to the user. | ||
alert('Hello, user!'); | ||
|
||
# Prompt the user for input. | ||
let userInput = prompt('What is your name?'); | ||
|
||
# Declare a function. | ||
function myFunction(arg1, arg2) { | ||
Function body goes here. | ||
} | ||
|
||
# Call a function. | ||
myFunction(value1, value2); | ||
|
||
# Declare an object. | ||
let myObject = { | ||
key1: 'value1', | ||
key2: 'value2', | ||
key3: 'value3', | ||
}; | ||
|
||
# Access an object's property. | ||
myObject.key1; | ||
|
||
# Declare an array. | ||
let myArray = [1, 2, 3, 4]; | ||
|
||
# Access an array's element. | ||
myArray[0]; | ||
|
||
# Declare a for loop. | ||
for (let i = 0; i < myArray.length; i++) { | ||
Loop body goes here. | ||
} | ||
|
||
# Declare a while loop. | ||
while (condition) { | ||
Loop body goes here. | ||
} | ||
|
||
# Declare an if statement. | ||
if (condition) { | ||
Code to execute if condition is true. | ||
} | ||
|
||
# Declare an if-else statement. | ||
if (condition) { | ||
Code to execute if condition is true. | ||
} else { | ||
Code to execute if condition is false. | ||
} | ||
|
||
# Declare a switch statement. | ||
switch (expression) { | ||
case value1: | ||
Code to execute if expression equals value1. | ||
break; | ||
case value2: | ||
Code to execute if expression equals value2. | ||
break; | ||
default: | ||
Code to execute if expression doesn't match any case. | ||
} | ||
|
||
# Declare a try-catch block. | ||
try { | ||
Code that might throw an error. | ||
} catch (error) { | ||
Code to handle the error. | ||
} | ||
|
||
# Declare a timeout function. | ||
setTimeout(function() { | ||
Code to execute after a delay. | ||
}, delay); | ||
|
||
# Declare an interval function. | ||
setInterval(function() { | ||
Code to execute repeatedly at an interval. | ||
}, interval); | ||
|
||
# Declare a callback function. | ||
function myFunction(callback) { | ||
Code to execute before the callback. | ||
callback(); | ||
Code to execute after the callback. | ||
} | ||
|
||
# Declare a promise. | ||
let myPromise = new Promise(function(resolve, reject) { | ||
Code that might resolve or reject the promise. | ||
}); | ||
|
||
# Use the then method of a promise. | ||
myPromise.then(function(result) { | ||
Code to execute if the promise resolves successfully. | ||
}).catch(function(error) { | ||
Code to execute if the promise is rejected. | ||
}); | ||
|
||
# Declare a class. | ||
class MyClass { | ||
constructor(arg1, arg2) { | ||
Constructor code goes here. | ||
} | ||
myMethod(arg1, arg2) { | ||
Method body goes here. | ||
} | ||
} | ||
|
||
# Declare a module. | ||
export function myFunction(arg1, arg2) { | ||
Code to export goes here. | ||
} | ||
|
||
# Import a module | ||
import { myFunction } from './my-module.js'; |
This file contains 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
Oops, something went wrong.