Flutter Lists

Flutter Basic Lists:

In this tutorial, we are going to learn about lists, that are useful for displaying data in mobile Apps. In Flutter we are using ListView to create Lists in Flutter App.

Creating a ListView:

Use the ListView constructor to create lists, this constructor contains few lists of items, We also use built-in ListTile Widget this gives our items a visual structure.

Use the below code to create ListView with ListView constructor and ListTile widget:

ListView(
children: [
ListTile(
leading: Icon(Icons.map),
title: Text('Map'),
),
ListTile(
leading: Icon(Icons.photo_album),
title: Text('Album'),
),
ListTile(
leading: Icon(Icons.phone),
title: Text('Phone'),
),
],
);

Below is the Complete example Code for ListView: 

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final title = 'Basic List';

return MaterialApp(
title: title,
home: Scaffold(
appBar: AppBar(
title: Text(title),
),
body: ListView(
children: [
ListTile(
leading: Icon(Icons.map),
title: Text('Map'),
),
ListTile(
leading: Icon(Icons.photo_album),
title: Text('Album'),
),
ListTile(
leading: Icon(Icons.phone),
title: Text('Phone'),
),
],
),
),
);
}
}

Congratulations You Have Learned Creating A Basic ListView In Flutter….!!!

If It Is Helpful Share It With Your Friends….!!! 

If You Have Any Query Make A Comment….!!!

Leave a Reply

Categories