Created
June 3, 2021 23:31
-
-
Save Kevin-Gomez10/46cae3b5691d732a50ba3f61464f7fd9 to your computer and use it in GitHub Desktop.
POO Act8 galería de fotos
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
import 'package:flutter/material.dart'; | |
main() { | |
runApp( | |
MaterialApp( | |
debugShowCheckedModeBanner: false, // quitar banner rojo | |
home: Galeriafotos(), | |
), | |
);// fin de runApp | |
}// fin de main | |
class Galeriafotos extends StatelessWidget { | |
List<String> imagenes=[ | |
"https://raw.githubusercontent.com/Kevin-Gomez10/mis-imagenes/main/paisaje%201.jpg", | |
"https://raw.githubusercontent.com/Kevin-Gomez10/mis-imagenes/main/paisaje%202.jpg", | |
"https://raw.githubusercontent.com/Kevin-Gomez10/mis-imagenes/main/paisaje%203.jpg", | |
"https://raw.githubusercontent.com/Kevin-Gomez10/mis-imagenes/main/paisaje%204.jpg" | |
]; // lista de imajenes | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
backgroundColor: Colors.black, | |
appBar: AppBar( | |
title: Text('Galeria de imagenes'), | |
centerTitle: true, | |
backgroundColor: Colors.purple | |
), | |
body: Container( | |
padding: EdgeInsets.all(18.0), | |
child: GridView.builder( | |
itemCount: imagenes.length, | |
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | |
crossAxisCount: | |
1, crossAxisSpacing: 4.0, mainAxisSpacing: 4.0), | |
itemBuilder: (BuildContext context, int index){ | |
return Image.network(imagenes[index]); | |
}, | |
)//Fin Hijo Gridview | |
),//Fin Contenedor | |
);// fin de scaffold | |
}// fin de widget | |
}// fin clase galeriafotos herencia StatelesWidget |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
link codigo funcionando ____>https://www.dartpad.dev/46cae3b5691d732a50ba3f61464f7fd9