Flutter Tutorials

Flutter app development tutorials


flutter – ListTile border bottom

main.dart


import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      theme: ThemeData(primarySwatch: Colors.green),
      home: Scaffold(
          appBar: AppBar(
              title: const Text("Flutter - ListTile Border Bottom")
          ),
          body: bodyContent()
      ),
    ),
  );
}

bodyContent(){
  return Center(
      child: ListView.builder(
        itemCount: 50,
        padding: const EdgeInsets.all(4),
        itemBuilder: (context,index){
          return Container(
            child: ListTile(
                title: Text("${index+1}. I am title"),
                subtitle: const Text("I am subtitle"),
                trailing: const Icon(Icons.share)
            ),
            decoration: BoxDecoration(
                border: Border(
                    bottom: BorderSide(
                        color: Colors.green.shade600, width: 1
                    )
                )
            )
          );
        }
      )
  );
}

More flutter tutorials



About Me

Flutter Developer

Design a site like this with WordPress.com
Get started