Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- void main() {
- runApp(new MaterialApp(
- title: "Card & Parsing",
- home: HalSatu(),
- ));
- }
- class HalSatu extends StatelessWidget {
- @override
- Widget build(BuildContext context) {
- // TODO: implement build
- return new Scaffold(
- appBar: new AppBar(
- title: new Text("Card & Parsing"),
- ),
- body: new Container(
- child: new Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: <Widget>[
- new cardSaya(icon: Icons.home, warna: Colors.brown, text: "Home",),
- new cardSaya(icon: Icons.favorite, warna: Colors.pink, text: "Favorite",),
- new cardSaya(icon: Icons.place, warna: Colors.blue, text: "Place",),
- new cardSaya(icon: Icons.settings, warna: Colors.black, text: "Setting",)
- ],
- ),
- ),
- );
- }
- }
- class cardSaya extends StatelessWidget {
- cardSaya ({this.icon, this.text, this.warna});
- final IconData icon;
- final String text;
- final Color warna;
- @override
- Widget build(BuildContext context) {
- // TODO: implement build
- return new Container(
- padding: new EdgeInsets.all(10.0),
- child: new Card(
- child: new Column(
- children: <Widget>[
- new Icon(icon, size: 50.0, color: warna),
- new Text(
- text,
- style: new TextStyle(fontSize: 20.0),
- )
- ],
- )),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment