Skip to content

Instantly share code, notes, and snippets.

@Wils0nDev
Created January 12, 2023 01:23
Show Gist options
  • Save Wils0nDev/a3ac8da8cfa1282fe4a0ea99e58185f9 to your computer and use it in GitHub Desktop.
Save Wils0nDev/a3ac8da8cfa1282fe4a0ea99e58185f9 to your computer and use it in GitHub Desktop.
Dart-HelloWorld
void main() {
//print("Hello World!");
//Type of data
//Boolean
print("Program to know if sunny or not");
bool isSunny = true;
print(isSunny);
print("--------------------------------------");
print("Program to know the old and stature");
print("Old");
int old = 20;
print(old);
print("stature");
double stature = 1.65;
print(stature);
print("--------------------------------------");
print("Program to know the name of a country");
print("Country");
String country = "Peru";
print(country);
print("---------------------------------------------");
print("Program to list fruts");
List<String> fruts = ["apple", "ornage", "banana"];
print(fruts);
print("---------------------------------------------");
print("Programan using var");
var name = "Wilson"; //string
var years = 32; //int
print(name);
print(years);
print("Programan using finaly and const");
const title = "Language Dart";
//title = "otro valor" //esto generara un error;
print(title);
final subtitle = "Tools DartPad";
print(subtitle);
const persons = {"name": "wilson", "lastname": "vasquez"};
print(persons);
//persons.addAll({"like":"true"}); //esto generara un error porq una constante no se puede modificar
//print(persons);
final animals = {"name": "gat", "feature": "vertebrate"};
print(animals);
animals.addAll({"like":"true"}); // a diferencia de final, no se puede modificar el objetro pero si sus componentes
print(animals); //en este caso se agrego uno nuevo
print("Programan using dynamic");
dynamic isName = true;
print(isName);
isName = "Wilson";
print(isName);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment