Hourglass
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:tasktracker/Data.dart';
|
||||
import 'package:tasktracker/NotificationsManager.dart';
|
||||
import 'main.dart';
|
||||
import 'User.dart' as User;
|
||||
@@ -123,6 +124,62 @@ class Dialogs{
|
||||
}
|
||||
}
|
||||
|
||||
static showProjectDetails(Project project) async{
|
||||
context=navigatorKey.currentContext;
|
||||
List<Widget> stepWidgets = [];
|
||||
for (ProjectStep value in project.steps) {
|
||||
stepWidgets.add(Text('[${value.progress}%] ${value.eta}h -> ${value.stepName}'));
|
||||
}
|
||||
if(context!=null) {
|
||||
return showDialog(
|
||||
context: context!,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
|
||||
backgroundColor: Color(0xFF1C1C1C),
|
||||
title: Text(project.name),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("deadline : ${project.deadline}"),
|
||||
Text("Steps"),
|
||||
SizedBox(height: 5),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: stepWidgets,
|
||||
)
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
MaterialButton(
|
||||
onPressed: (){
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text('Delete', style:TextStyle(color: Colors.red)),
|
||||
),
|
||||
MaterialButton(
|
||||
onPressed: (){
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text('Edit', style:TextStyle(color: Colors.yellow)),
|
||||
),
|
||||
MaterialButton(
|
||||
onPressed: (){
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: Text('Close', style:TextStyle(color: Colors.white)),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
);
|
||||
}else{
|
||||
print('context is null');
|
||||
}
|
||||
}
|
||||
|
||||
static hide(){
|
||||
showing=false;
|
||||
Navigator.of(navigatorKey.currentContext!).popUntil((route){
|
||||
|
||||
Reference in New Issue
Block a user