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

@@ -270,7 +270,15 @@ class NewProject2 extends StatefulWidget {
}
class _NewProject2State extends State<NewProject2> {
bool knowEta = false;
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));
late String? projectName;
_NewProject2State({String? pName}) {
@@ -294,7 +302,28 @@ class _NewProject2State extends State<NewProject2> {
? 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<NewProject2> {
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<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;
}
}