11import 'package:flutter/material.dart' ;
2+ import 'quote.dart' ;
23
34void main () => runApp (MaterialApp (
45 home: QuoteList ()
@@ -11,10 +12,16 @@ class QuoteList extends StatefulWidget {
1112
1213class _QuoteListState extends State <QuoteList > {
1314
14- List <String > quotes = [
15- 'Be yourself; everyone else is already taken' ,
16- 'I have nothing to declare except my genius' ,
17- 'The truth is rarely pure and never simple'
15+ // List<String> quotes = [
16+ // 'Be yourself; everyone else is already taken',
17+ // 'I have nothing to declare except my genius',
18+ // 'The truth is rarely pure and never simple'
19+ // ];
20+
21+ List <Quote > quotes = [
22+ Quote (author: 'Oscar Wilde' , text: 'Be yourself; everyone else is already taken' ),
23+ Quote (author: 'Oscar Wilde' , text: 'I have nothing to declare except my genius' ),
24+ Quote (author: 'Oscar Wilde' , text: 'The truth is rarely pure and never simple' )
1825 ];
1926
2027 @override
@@ -27,7 +34,7 @@ class _QuoteListState extends State<QuoteList> {
2734 backgroundColor: Colors .redAccent,
2835 ),
2936 body: Column (
30- children: quotes.map ((quote) => Text (quote)).toList (),
37+ children: quotes.map ((quote) => Text ('${ quote . text } - ${ quote . author }' )).toList (),
3138 ),
3239 );
3340 }
0 commit comments