Skip to content

Instantly share code, notes, and snippets.

@siumhossain
Created February 14, 2021 09:14
Show Gist options
  • Save siumhossain/7ed1577ea980a0a7e83baed0498eda8b to your computer and use it in GitHub Desktop.
Save siumhossain/7ed1577ea980a0a7e83baed0498eda8b to your computer and use it in GitHub Desktop.
print list value in flutter
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