New project started, Single step page started

This commit is contained in:
Sewmina
2022-03-14 20:30:20 +05:30
parent ef34729de6
commit 26c6907d43
2 changed files with 93 additions and 22 deletions

View File

@@ -89,6 +89,13 @@ class Queries{
static String colData = "data"; static String colData = "data";
} }
class ProjectStep{
ProjectStep(this.stepName,this.eta);
String stepName;
int eta;
}

View File

@@ -270,7 +270,15 @@ class NewProject2 extends StatefulWidget {
} }
class _NewProject2State extends State<NewProject2> { class _NewProject2State extends State<NewProject2> {
bool knowEta = false;
int etaHours = 1; int etaHours = 1;
List<ProjectStep> 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)); DateTime deadline = DateTime.now().add(Duration(days:7));
late String? projectName; late String? projectName;
_NewProject2State({String? pName}) { _NewProject2State({String? pName}) {
@@ -294,7 +302,28 @@ class _NewProject2State extends State<NewProject2> {
? Column( ? Column(
children: [ children: [
Column( 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<NewProject2> {
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: Text( child: Text(
"Estimated Time to reach target")), "Estimated Time to reach target")),
InkWell( Row(
onTap: () { mainAxisSize: MainAxisSize.max,
showDurationSelector(context,selectedHour: etaHours, onChange: (newVal){ mainAxisAlignment: MainAxisAlignment.spaceAround,
etaHours = newVal.inHours; children: [
setState(() { InkWell(
onTap: () {
showDurationSelector(context,selectedHour: etaHours, onChange: (newVal){
etaHours = newVal.inHours;
knowEta=true;
setState(() {
}); });
print("Selected $newVal"); print("Selected $newVal");
}); });
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white10, color: (knowEta) ? Colors.green:Colors.white10,
borderRadius: borderRadius:
BorderRadius.circular(30), BorderRadius.circular(30),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 100, vertical: 10), horizontal: 50, vertical: 10),
child: Text("$etaHours Hours"), 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( SizedBox(
height: 20, height: 20,
@@ -415,4 +468,15 @@ class _NewProject2State extends State<NewProject2> {
)) ))
]))); ])));
} }
int selectedStep = 0;
List<Widget> printSteps(){
List<Widget> _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;
}
} }