Last active
November 1, 2022 03:33
-
-
Save sriram-srinivasan/ae3f211b40d6c78716b6da5a2d8051a1 to your computer and use it in GitHub Desktop.
List + Textbook inside Column
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(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: const MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
const MyHomePage({super.key, required this.title}); | |
final String title; | |
@override | |
State<MyHomePage> createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.end, | |
children: [ | |
Expanded(child: _buildList()), | |
_buildMessageBar() | |
] | |
), | |
), | |
); | |
} | |
Widget _buildList() { | |
return ListView.builder( | |
itemCount: 200, | |
itemBuilder: (BuildContext context, int i) { | |
return Padding( | |
padding: const EdgeInsets.all(4), | |
child: ListTile( | |
title: Text("Tile #$i", style: Theme.of(context).textTheme.bodyText1), | |
tileColor: Colors.lightGreen.withOpacity(0.1), | |
) | |
); | |
} | |
); | |
} | |
Widget _buildMessageBar() { | |
return const SizedBox(height: 50, child: Text("This is a status message bar")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment