From dd0597b51a04a4888e28f82c86d0c88ef6190ce4 Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Sun, 18 Oct 2020 14:52:16 +0200 Subject: [PATCH] Slight improvement to code that generates the month pracice buttons --- lib/pages/practice/month/MonthPracticePage.dart | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/lib/pages/practice/month/MonthPracticePage.dart b/lib/pages/practice/month/MonthPracticePage.dart index d049d9e..3ba0fc0 100644 --- a/lib/pages/practice/month/MonthPracticePage.dart +++ b/lib/pages/practice/month/MonthPracticePage.dart @@ -52,7 +52,11 @@ class _MonthPracticeState extends State { Widget getButtons(){ List buttons = new List(); - for(int i in [1,2,3,4,5,6]){ + for(int i in [1,2,3,4,5,6,-1,0,-1]){ + if (i == -1){ + buttons.add(Container()); + continue; + } buttons.add( new FlatButton( onPressed: () { @@ -64,17 +68,6 @@ class _MonthPracticeState extends State { ) ); } - buttons.add(Container()); - buttons.add(new FlatButton( - onPressed: () { - checkMonth(0); - }, - color: Colors.blue, - textColor: Colors.white, - child: new Text("0") - ) - ); - buttons.add(Container()); return new GridView.count( primary: false, crossAxisCount: 3,