some polishings
This commit is contained in:
@@ -424,24 +424,22 @@ class _ActivitiesState extends State<Activities> {
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
|
||||
Row(mainAxisSize: MainAxisSize.max,children: [
|
||||
Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.start, children: [
|
||||
Text(name + " [$timeSpan]", style: TextStyle(fontSize: 17)),
|
||||
if (containsMetadata)
|
||||
if (containsMetadata)Row(mainAxisAlignment:MainAxisAlignment.start,mainAxisSize: MainAxisSize.max,children: [
|
||||
|
||||
Icon(
|
||||
Icons.arrow_forward_outlined,
|
||||
size: 20,
|
||||
),
|
||||
if (containsMetadata)
|
||||
SizedBox(
|
||||
width: 150,
|
||||
width: MediaQuery.of(context).size.width/3,
|
||||
child: Text(
|
||||
activity.metadata ?? '',
|
||||
),
|
||||
),
|
||||
|
||||
]),
|
||||
|
||||
// Icon(Icons.analytics, color: color, size: 20,),
|
||||
]),
|
||||
SizedBox(
|
||||
|
||||
@@ -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(){
|
||||
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
await User.refreshUserData();
|
||||
|
||||
}
|
||||
DateTime? lastProductive = null;
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
@@ -193,6 +194,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
firstDay = null;
|
||||
lastDay = null;
|
||||
String lastDate = "";
|
||||
lastProductive=null;
|
||||
days = [];
|
||||
for (var element in User.activities) {
|
||||
if (lastDay == null) {
|
||||
@@ -228,6 +230,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
}
|
||||
|
||||
if (element.taskType.cat?.productive ?? false) {
|
||||
if(lastProductive==null){lastProductive = element.trueEndTime;}
|
||||
if (productivtyActs.containsKey(thisDate)) {
|
||||
productivtyActs[thisDate] = (productivtyActs[thisDate]! + thisMinutes);
|
||||
} else {
|
||||
@@ -415,7 +418,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
)
|
||||
: Container(),
|
||||
Container(
|
||||
height: 300,
|
||||
height: 350,
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Card(
|
||||
elevation: 8,
|
||||
@@ -470,7 +473,16 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
dataLabelSettings: DataLabelSettings(overflowMode: OverflowMode.hide, showZeroValue: false, isVisible: true),
|
||||
color: Colors.green)
|
||||
]),
|
||||
)
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
if(lastProductive!=null && DateTime.now().difference(lastProductive!).inMinutes > 60)RichText(text: TextSpan(
|
||||
children: <TextSpan>[
|
||||
TextSpan(text: "You haven't been productive in last",style: TextStyle(color:Colors.orange)),
|
||||
TextSpan(text:" ${MinutesToTimeString(DateTime.now().difference(lastProductive!).inMinutes)}",style: TextStyle(color:Colors.redAccent,fontWeight: FontWeight.bold))
|
||||
]
|
||||
))
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user