Created
February 14, 2021 09:14
-
-
Save siumhossain/7ed1577ea980a0a7e83baed0498eda8b to your computer and use it in GitHub Desktop.
print list value in flutter
This file contains hidden or 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(MaterialApp( | |
| home: QuoteList() | |
| )); | |
| class QuoteList extends StatefulWidget { | |
| @override | |
| _QuoteListState createState() => _QuoteListState(); | |
| } | |
| class _QuoteListState extends State<QuoteList> { | |
| List<String> quotes = [ | |
| 'Be yourself; everyone else is already taken', | |
| 'I have nothing to declare except my genius', | |
| 'The truth is rarely pure and never simple' | |
| ]; | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| backgroundColor: Colors.grey[200], | |
| appBar: AppBar( | |
| title: Text('Awesome Quotes'), | |
| centerTitle: true, | |
| backgroundColor: Colors.redAccent, | |
| ), | |
| body: Column( | |
| children: quotes.map((quote) => Text(quote)).toList(), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment