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
public static void main (String[] args) { | |
//a map with key type : String, value type : String | |
Map<String,String> mp = new HashMap<String,String>(); | |
mp.put("John","Math"); mp.put("Jack","Math"); map.put("Jeff","History"); | |
//3 differents ways to iterate over the map | |
for (String key : mp.keySet()){ | |
//iterate over keys | |
System.out.println(key+" "+mp.get(key)); | |
} |
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
//si retorna true - la cédula es válida | |
//si retorna false - la cédula es false | |
bool cedulaEcuatorianaValida(String cedula) { | |
int sum = 0; | |
try { | |
if (cedula.trim().length != 10) { | |
return false; | |
} | |
List<String> data = cedula.split(""); |
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
#Ejemplo 1 | |
Widget myLayoutWidget() { | |
return Align( | |
alignment: Alignment(0.7, -0.5), | |
child: Text( | |
"widget", | |
style: TextStyle(fontSize: 30), | |
), | |
); | |
} |