Home Mobile Basic List Widget

Basic List Widget

0

A. Pengertian Basic List Widget

List adalah struktur data yang memungkinkan kita menyimpan banyak nilai di dalam suatu variabel. Dalam bahasa pemrograman lain, list biasanya dikenal dengan sebutan array.

import 'package:flutter/material.dart';

void main() {
  runApp( new MyApp());
}
class MyApp extends StatelessWidget{

  @override
  Widget build(BuildContext context) {

    return new MaterialApp(
      title: 'Dummy Application',
      home: Scaffold(
        appBar: new AppBar(title: new Text('List Widget'),),
        body: new ListView(
          children: <Widget>[
            new ListTile(
              title : Text('list item1'),
              trailing: new Icon(Icons.arrow_forward),
            ),
            new ListTile(
              title: Text('list item1'),
              trailing: new Icon(Icons.arrow_forward),
            ),
            new ListTile (
              title: Text('list item1'),
              trailing: new Icon(Icons.arrow_forward),
            ),
          ],
        ),
      ),
    );
  }
}

Hasil Running: