Skip to content

Instantly share code, notes, and snippets.

@danim1130
danim1130 / main.dart
Last active February 2, 2021 15:31
Late initialization
bool test1(){
print("Test1 function");
return true;
}
bool test2(){
print("Test2 function");
return true;
}
@danim1130
danim1130 / main.dart
Last active February 5, 2021 19:42
Control flow
void main() {
bool myFlag = true;
if (myFlag){
print("True");
} else if (!myFlag) {
print("False");
} else {
print("Null");
}
@danim1130
danim1130 / main.dart
Created September 8, 2020 14:06
String functions
void main() {
//Sztring deklarálás
var testSimpleString = "Hello World!";
var testNewLineString = "Hello\r\nWorld!";
var testNewLineRawString = r"Hello\r\nWorld!";
var testMultiLineStringFirst = "Hello " +
"World" +
"!";
var testMultiLineStringSecond = '''
Hello
@danim1130
danim1130 / main.dart
Created September 8, 2020 01:05
Dart - Primitive types
void main() {
//Különbség int és double között
int firstInt = 5;
double firstDouble = 5;
num firstNum = 5;
print("Testing 5");
print(firstInt.runtimeType);
print(firstDouble.runtimeType);
print(firstNum.runtimeType);
@danim1130
danim1130 / main.dart
Last active February 2, 2021 15:06
Dart - Variable declaration
//Global variable
bool globalFlag = false;
void main(List<String> args) {
//Declaration with initialization
String myString = "My string";
print("String interpolation: $myString");
//Declaration without initialization
String tempString;
@danim1130
danim1130 / main.dart
Created September 7, 2020 11:54
Hello World
void main() {
print("Hello World!");
}
/
THE BOY WHO LIVED
Mr. and Mrs. Dursley, of number four, Privet Drive,
were proud to say that they were perfectly normal,
thank you very much. They were the last people you’d