diff --git a/lib/Data.dart b/lib/Data.dart index 2bd3bdc..58f4d8e 100644 --- a/lib/Data.dart +++ b/lib/Data.dart @@ -89,6 +89,13 @@ class Queries{ static String colData = "data"; } +class ProjectStep{ + ProjectStep(this.stepName,this.eta); + + String stepName; + int eta; +} + diff --git a/lib/NewProject.dart b/lib/NewProject.dart index 6960f8d..3b3dd86 100644 --- a/lib/NewProject.dart +++ b/lib/NewProject.dart @@ -270,7 +270,15 @@ class NewProject2 extends StatefulWidget { } class _NewProject2State extends State { + bool knowEta = false; int etaHours = 1; + List steps = [ + ProjectStep('Step 1', 3), + ProjectStep('Step 2', 2), + ProjectStep('Ez Step', 1), + ProjectStep('Very hard', 10), + ProjectStep('Finishing', 5) + ]; DateTime deadline = DateTime.now().add(Duration(days:7)); late String? projectName; _NewProject2State({String? pName}) { @@ -294,7 +302,28 @@ class _NewProject2State extends State { ? Column( children: [ Column( - children: [Text("eeeeeeee")], + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(10), + child: Text('List your steps down') + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20), + color: Colors.white10, + ), + padding: EdgeInsets.all(10), + + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child:Column( + children: printSteps(), + ) + ), + ), + ], ) ], ) @@ -307,28 +336,52 @@ class _NewProject2State extends State { padding: EdgeInsets.all(10), child: Text( "Estimated Time to reach target")), - InkWell( - onTap: () { - showDurationSelector(context,selectedHour: etaHours, onChange: (newVal){ - etaHours = newVal.inHours; - setState(() { + Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + InkWell( + onTap: () { + showDurationSelector(context,selectedHour: etaHours, onChange: (newVal){ + etaHours = newVal.inHours; + knowEta=true; + setState(() { - }); - print("Selected $newVal"); - }); - }, - child: Container( - decoration: BoxDecoration( - color: Colors.white10, - borderRadius: - BorderRadius.circular(30), - ), - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 100, vertical: 10), - child: Text("$etaHours Hours"), - ), - ), + }); + print("Selected $newVal"); + }); + }, + child: Container( + decoration: BoxDecoration( + color: (knowEta) ? Colors.green:Colors.white10, + borderRadius: + BorderRadius.circular(30), + ), + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 50, vertical: 10), + child: Text("${(knowEta)?etaHours:'?'} Hours"), + ), + ), + ),InkWell( + onTap: (){ + knowEta=false; + setState(() { + + }); + }, + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(30), + color: (knowEta) ? Colors.white10 :Colors.redAccent + ), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20,vertical: 10), + child: Text("I have no idea"), + ) + ), + ) + ], ), SizedBox( height: 20, @@ -415,4 +468,15 @@ class _NewProject2State extends State { )) ]))); } + int selectedStep = 0; + List printSteps(){ + List _steps = []; + + for(int i=0; i < steps.) + _steps.add( + InkWell(onTap:(){se},child: Container(padding:EdgeInsets.symmetric(horizontal: 10,vertical: 2),child: Row(mainAxisSize:MainAxisSize.max,mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [Text(value.stepName), Icon(Icons.timelapse), Text(value.eta.toString() + " Hours")],)))); + } + + return _steps; + } }