Last active
May 11, 2020 18:44
-
-
Save stegrams/c597de94bccf7b6204f1b0645e09758e to your computer and use it in GitHub Desktop.
Grid view sample with 2 texts per row.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
home: MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatelessWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(title), | |
), | |
body: GridView.count( | |
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 20), | |
crossAxisCount: 2, | |
childAspectRatio: 2, | |
children: <Widget>[ | |
...[Text('15.00'), Text('AJC Bose Rd Flyover Connector')], | |
...[Text('15.45'), Text('Shibpur B.E College')], | |
...[Text('16.00'), Text('Kona Express & Ichapur Road')], | |
...[Text('16.05'), Text('Ichapur Water Tank Howrah')], | |
...[Text('16.15'), Text('Mandirtala')], | |
...[Text('16.15'), Text('Mandirtala')], | |
...[Text('16.15'), Text('Mandirtala')], | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment