ListView In Flutter - Advance Flutter Course

 import 'package:flutter/material.dart';


void main() {
  runApp(Directionality(
      textDirection: TextDirection.ltr,
      child: ListView(
        padding: EdgeInsets.symmetric(vertical: 20),
        children: [
          Container(
              height: 100,
              color: Colors.green,
              child: Center(
                child: Text(
                  '1',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.blue,
              child: Center(
                child: Text(
                  '2',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.yellow,
              child: Center(
                child: Text(
                  '3',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.cyan,
              child: Center(
                child: Text(
                  '4',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.green,
              child: Center(
                child: Text(
                  '5',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.blue,
              child: Center(
                child: Text(
                  '6',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.yellow,
              child: Center(
                child: Text(
                  '7',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.cyan,
              child: Center(
                child: Text(
                  '8',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.cyan,
              child: Center(
                child: Text(
                  '9',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
          Container(
              height: 100,
              color: Colors.cyan,
              child: Center(
                child: Text(
                  '10',
                  textDirection: TextDirection.ltr,
                  style: TextStyle(fontSize: 20),
                ),
              )),
        ],
      )));
}

Comments

Popular Posts