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:beautiful_list/model/lesson.dart'; |
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
List getLessons() { | |
return [ | |
Lesson( | |
title: "Introduction to Driving", | |
level: "Beginner", | |
indicatorValue: 0.33, | |
price: 20, | |
content: | |
"Start by taking a couple of minutes to read the info in this section. Launch your app and click on the Settings menu. While on the settings page, click the Save button. You should see a circular progress indicator display in the middle of the page and the user interface elements cannot be clicked due to the modal barrier that is constructed."), | |
Lesson( |
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
class _ListPageState extends State<ListPage> { | |
List lessons; | |
@override | |
void initState() { | |
lessons = getLessons(); | |
super.initState(); | |
} | |
.... |
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
class _ListPageState extends State<ListPage> { | |
List lessons; | |
@override | |
void initState() { | |
lessons = getLessons(); | |
super.initState(); | |
} | |
.... |
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
Card makeCard(Lesson lesson) => Card( | |
elevation: 8.0, | |
margin: new EdgeInsets.symmetric(horizontal: 10.0, vertical: 6.0), | |
child: Container( | |
decoration: BoxDecoration(color: Color.fromRGBO(64, 75, 96, .9)), | |
child: makeListTile(lesson), | |
), | |
); |
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
ListTile makeListTile(Lesson lesson) => ListTile( | |
contentPadding: | |
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), | |
leading: Container( | |
padding: EdgeInsets.only(right: 12.0), | |
decoration: new BoxDecoration( | |
border: new Border( | |
right: new BorderSide(width: 1.0, color: Colors.white24))), | |
child: Icon(Icons.autorenew, color: Colors.white), | |
), |
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
ListTile makeListTile(Lesson lesson) => ListTile( | |
contentPadding: | |
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), | |
leading: Container( | |
padding: EdgeInsets.only(right: 12.0), | |
decoration: new BoxDecoration( | |
border: new Border( | |
right: new BorderSide(width: 1.0, color: Colors.white24))), | |
child: Icon(Icons.autorenew, color: Colors.white), | |
), |
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
ListTile makeListTile(Lesson lesson) => ListTile( | |
contentPadding: | |
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), | |
leading: Container( | |
padding: EdgeInsets.only(right: 12.0), | |
decoration: new BoxDecoration( | |
border: new Border( | |
right: new BorderSide(width: 1.0, color: Colors.white24))), | |
child: Icon(Icons.autorenew, color: Colors.white), | |
), |
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
ListTile makeListTile(Lesson lesson) => ListTile( | |
contentPadding: | |
EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), | |
leading: Container( | |
padding: EdgeInsets.only(right: 12.0), | |
decoration: new BoxDecoration( | |
border: new Border( | |
right: new BorderSide(width: 1.0, color: Colors.white24))), | |
child: Icon(Icons.autorenew, color: Colors.white), | |
), |
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
onTap: () { | |
Navigator.push( | |
context, | |
MaterialPageRoute( | |
builder: (context) => DetailPage(lesson: lesson))); | |
} |