Skip to content

Instantly share code, notes, and snippets.

@Kevin-Gomez10
Created June 3, 2021 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kevin-Gomez10/46cae3b5691d732a50ba3f61464f7fd9 to your computer and use it in GitHub Desktop.
Save Kevin-Gomez10/46cae3b5691d732a50ba3f61464f7fd9 to your computer and use it in GitHub Desktop.
POO Act8 galería de fotos
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
@Kevin-Gomez10
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment