Skip to content

Commit

Permalink
Created the ListView inside the new view route.
Browse files Browse the repository at this point in the history
Filled the new listView with the contents of the saved choices.
Added divider tiles to the listView.
Created a Scaffold view for the new AppBar and body to view the ListView.
Changed the theme to be white.
  • Loading branch information
milandeepbassi committed Jan 16, 2020
1 parent 48f8c31 commit 96064d0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class MyApp extends StatelessWidget {
);*/
return MaterialApp(
title: "Start up Name Generator",
theme: ThemeData( // Add the 3 lines from here...
primaryColor: Colors.white,
),
home: RandomWords(),
);
}
Expand Down Expand Up @@ -82,7 +85,36 @@ class RandomWordsState extends State<RandomWords> {
},
);
}

void _pushSaved() {
Navigator.of(context).push(
MaterialPageRoute<void>( // Add 20 lines from here...
builder: (BuildContext context) {
final Iterable<ListTile> tiles = _saved.map(
(WordPair pair) {
return ListTile(
title: Text(
pair.asPascalCase,
style: _biggerFont,
),
);
},
);
final List<Widget> divided = ListTile
.divideTiles(
context: context,
tiles: tiles,
)
.toList();
return Scaffold( // Add 6 lines from here...
appBar: AppBar(
title: Text('Saved Suggestions'),
),
body: ListView(children: divided),
); // ... to here.
},
), // ... to here.
);
}
}

Expand Down

0 comments on commit 96064d0

Please sign in to comment.