Created
September 23, 2019 14:49
-
-
Save alamsyahh15/f88b130c48b33fec141730b26c85c82a to your computer and use it in GitHub Desktop.
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'; | |
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