Skip to content

Instantly share code, notes, and snippets.

@alamsyahh15
Created September 23, 2019 14:49
Show Gist options
  • Save alamsyahh15/f88b130c48b33fec141730b26c85c82a to your computer and use it in GitHub Desktop.
Save alamsyahh15/f88b130c48b33fec141730b26c85c82a to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
class ListHorizontal extends StatelessWidget {
const ListHorizontal({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('List Horizontal'),
backgroundColor: Colors.amberAccent,
),
body: Container(
// margin : jarak antara widget
// Padding : jarak didalam object
margin: EdgeInsets.symmetric(vertical: 20.0),
height: 200,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Container(
width: 160.0,
height: 200.0,
color: Colors.red,
),
Container(
width: 160.0,
height: 200.0,
color: Colors.blue,
),
Container(
width: 160.0,
height: 200.0,
color: Colors.yellow,
),
Container(
width: 160.0,
height: 200.0,
color: Colors.orange,
),
Container(
width: 160.0,
height: 200.0,
color: Colors.green,
)
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment