Skip to content

Instantly share code, notes, and snippets.

@kennedisimbolo
Created November 22, 2020 06:42
Show Gist options
  • Save kennedisimbolo/8e3f9c37a19e67f27c7d4c2fc49ad201 to your computer and use it in GitHub Desktop.
Save kennedisimbolo/8e3f9c37a19e67f27c7d4c2fc49ad201 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
backgroundColor: Colors.green,
title: Text('PARSING KENNEDI SIMBOLON'),
),
body: new GridView.count(
crossAxisCount: 4,
children: <Widget>[
Container(
color: Colors.yellow,
child: Center(
child: Contoh(
gbr: 'artis1.PNG.jpg', nama: ' Kagura', alamat: ' Rusia'),
),
),
Container(
color: Colors.yellow,
child: Center(
child: Contoh(
gbr: 'artis2.PNG.jpg',
nama: ' Fanny ',
alamat: ' Land of down'),
),
),
Container(
color: Colors.yellow,
child: Center(
child: Contoh(
gbr: 'artis3.PNG.jpg', nama: ' Aisya ', alamat: ' Maluku'),
),
),
Container(
color: Colors.yellow,
child: Center(
child: Contoh(
gbr: 'artis4.PNG.jpg',
nama: ' Dinasha ',
alamat: ' Medan '),
),
),
Container(
color: Colors.green,
child: Center(
child: Contoh(
gbr: 'artis10.PNG.jpg',
nama: ' Neymar ',
alamat: ' Brasil '),
),
),
Container(
color: Colors.green,
child: Center(
child: Contoh(
gbr: 'artis5.PNG.jpg',
nama: ' Caterne ',
alamat: ' Singapura '),
),
),
Container(
color: Colors.green,
child: Center(
child: Contoh(
gbr: 'artis6.PNG.jpg',
nama: ' Anita ',
alamat: ' Jakarta '),
),
),
Container(
color: Colors.green,
child: Center(
child: Contoh(
gbr: 'artis7.PNG.jpg',
nama: ' Riyani ',
alamat: ' Surabaya '),
),
),
Container(
color: Colors.blue,
child: Center(
child: Contoh(
gbr: 'artis8.PNG.jpg', nama: ' Indah ', alamat: ' Bali '),
),
),
Container(
color: Colors.blue,
child: Center(
child: Contoh(
gbr: 'artis9.PNG.jpg', nama: ' Zoro ', alamat: ' Jepang '),
),
),
],
),
),
);
}
}
class Contoh extends StatelessWidget {
Contoh({this.gbr, this.nama, this.alamat});
final String gbr;
final String nama;
final String alamat;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(10.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image(
image: NetworkImage(
'https://raw.githubusercontent.com/kennedisimbolo/kennedi-/main/' +
gbr),
height: 100.0),
Text('Jenis:' + nama),
Text('Alamat:' + alamat),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment