redesigned practice setup page to allow for different type of practicing

This commit is contained in:
BroodjeAap 2020-10-27 21:18:40 +01:00
parent 7864ede6ee
commit a0ce8e9230

View file

@ -16,16 +16,19 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
return Scaffold( return Scaffold(
drawer: AppDrawer(), drawer: AppDrawer(),
appBar: AppBar( appBar: AppBar(
title: Text("Practice Months"), title: Text("Practice"),
), ),
body: Center( body: Center(
child: Container( child: Container(
padding: EdgeInsets.all(20), padding: EdgeInsets.all(20),
child: Column( child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text( Text(
"How many rounds?", "How many rounds",
style: TextStyle(fontSize: 30), style: TextStyle(fontSize: 20),
), ),
NumberPicker.integer( NumberPicker.integer(
initialValue: _count, initialValue: _count,
@ -33,10 +36,14 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
maxValue: 500, maxValue: 500,
onChanged: (newNumber) => onChanged: (newNumber) =>
setState(() => _count = newNumber), setState(() => _count = newNumber),
)
]
), ),
SizedBox(height: 30),
CheckboxListTile( CheckboxListTile(
title: Text("Show correct Answer"), title: Text(
"Show correct Answer",
style: TextStyle(fontSize: 20)
),
value: _showCorrect, value: _showCorrect,
onChanged: (value) { onChanged: (value) {
setState(() { setState(() {
@ -44,8 +51,28 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
}); });
} }
), ),
SizedBox(height: 30), Spacer(),
Table(
border: TableBorder(
//horizontalInside: BorderSide(),
//verticalInside: BorderSide()
),
children: <TableRow>[
TableRow(
children: <Widget>[
// Header
Text(""),
Text("7d", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("30d", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("All", textAlign: TextAlign.center, style: TextStyle(fontSize: 25))
]
),
TableRow(
children: <Widget>[
FlatButton( FlatButton(
child: Text("Month"),
color: Colors.blue,
textColor: Colors.white,
onPressed: () { onPressed: () {
Navigator.pushNamed( Navigator.pushNamed(
context, context,
@ -53,11 +80,53 @@ class _PracticeSetupState extends State<PracticeSetupPage> {
arguments: PracticeSetup(_count, _showCorrect) arguments: PracticeSetup(_count, _showCorrect)
); );
}, },
child: Text("Start!"), ),
Text("85%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("70%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("50%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25))
]
),
TableRow(
children: <Widget>[
FlatButton(
child: Text("Year"),
color: Colors.blue, color: Colors.blue,
textColor: Colors.white, textColor: Colors.white,
padding: EdgeInsets.all(8.0) onPressed: () {},
) ),
Text("80%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("70%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("50%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25))
]
),
TableRow(
children: <Widget>[
FlatButton(
child: Text("Leap"),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {},
),
Text("80%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("70%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("50%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25))
]
),
TableRow(
children: <Widget>[
FlatButton(
child: Text("All"),
color: Colors.blue,
textColor: Colors.white,
onPressed: () {},
),
Text("80%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("70%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25)),
Text("50%", textAlign: TextAlign.center, style: TextStyle(fontSize: 25))
]
),
]
),
] ]
) )
) )