some polishings
This commit is contained in:
@@ -176,20 +176,6 @@ class _NewProjectState extends State<NewProject> {
|
||||
)
|
||||
]),
|
||||
));
|
||||
|
||||
void add_action() async {
|
||||
String catName = nameController.value.text;
|
||||
|
||||
if (catName.length < 2) {
|
||||
Dialogs.showAlertDialog(context, 'Category needs a name', 'Please enter a name for this category');
|
||||
return;
|
||||
}
|
||||
var hex = '#${pickerColor.value.toRadixString(16)}';
|
||||
await User.UserOperations.addCategory(catName, hex, productive);
|
||||
Navigator.of(context).popUntil((route) {
|
||||
return route.isFirst;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
String _printDuration(Duration duration) {
|
||||
@@ -207,12 +193,11 @@ class NewProject2 extends StatefulWidget {
|
||||
@override
|
||||
State<NewProject2> createState() => _NewProject2State(pName: projectName);
|
||||
}
|
||||
|
||||
bool knowEta = false;
|
||||
int etaHours = 1;
|
||||
List<ProjectStep> steps = [];
|
||||
DateTime deadline = DateTime.now().add(Duration(days: 7));
|
||||
class _NewProject2State extends State<NewProject2> {
|
||||
bool knowEta = false;
|
||||
int etaHours = 1;
|
||||
List<ProjectStep> steps = [];
|
||||
DateTime deadline = DateTime.now().add(Duration(days: 7));
|
||||
late String? projectName;
|
||||
_NewProject2State({String? pName}) {
|
||||
projectName = pName;
|
||||
@@ -222,9 +207,8 @@ class _NewProject2State extends State<NewProject2> {
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
List<Widget> stepsWidgets = printSteps();
|
||||
int totalHours = 0;
|
||||
steps.forEach((element) {
|
||||
totalHours+=element.eta;
|
||||
etaHours+=element.eta;
|
||||
});
|
||||
|
||||
return Scaffold(
|
||||
@@ -355,7 +339,7 @@ class _NewProject2State extends State<NewProject2> {
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Text("Total time : $totalHours Hours"),
|
||||
Text("Total time : $etaHours Hours"),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -674,3 +658,9 @@ class _NewProject2State extends State<NewProject2> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void OnClickedAdd(){
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user