Hourglass
This commit is contained in:
@@ -176,7 +176,7 @@ class _ActivitiesState extends State<Activities> {
|
||||
}
|
||||
|
||||
|
||||
List<Widget> PrintTasks() {
|
||||
List<Widget> PrintTasks() {
|
||||
List<Widget> _tasks = [];
|
||||
print('Priting cats : ' + User.taskTypes.length.toString());
|
||||
String lastDate = "";
|
||||
@@ -303,77 +303,83 @@ class _ActivitiesState extends State<Activities> {
|
||||
|
||||
Widget DateSeperator(date, prodActs, unprodActs) {
|
||||
// double prodPercentage = (prodActs / (prodActs + unprodActs)) * 100;
|
||||
double prodPercentage = (prodActs / 1440) * 100;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 20, 10, 0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
|
||||
return FutureBuilder(
|
||||
future: Settings.getUntrackedUnproductive(),
|
||||
builder: (context, snapshot) {
|
||||
double prodPercentage = (User.ParseBool(snapshot.data))? ((prodActs / 1440) * 100) : ((prodActs / unprodActs) * 100);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 20, 10, 0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
SizedBox(width: 15,),
|
||||
Icon(Icons.circle),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(
|
||||
date,
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
if(prodPercentage < 35)Text(Main.MinutesToTimeString(prodActs),),
|
||||
Container(
|
||||
child: Align(
|
||||
child: (prodPercentage >= 35) ?Text(Main.MinutesToTimeString(prodActs),) : Container(),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
width: (prodPercentage) * 1,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(color: Colors.green, borderRadius: BorderRadius.horizontal(left: Radius.circular(10))),
|
||||
SizedBox(width: 15,),
|
||||
Icon(Icons.circle),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Container(
|
||||
child: Align(
|
||||
child: (prodPercentage < 35) ?Text(Main.MinutesToTimeString(unprodActs)) :Container(),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
width: (100 - prodPercentage) * 1,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.horizontal(right: Radius.circular(10))),
|
||||
Text(
|
||||
date,
|
||||
style: TextStyle(fontSize: 18),
|
||||
),
|
||||
if(prodPercentage >= 35)Text(Main.MinutesToTimeString(unprodActs))
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(prodPercentage.toStringAsFixed(1) + "%", style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold, fontSize: 20))
|
||||
Row(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
if(prodPercentage < 35)Text(Main.MinutesToTimeString(prodActs),),
|
||||
Container(
|
||||
child: Align(
|
||||
child: (prodPercentage >= 35) ?Text(Main.MinutesToTimeString(prodActs),) : Container(),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
width: (prodPercentage) * 1,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(color: Colors.green, borderRadius: BorderRadius.horizontal(left: Radius.circular(10))),
|
||||
),
|
||||
Container(
|
||||
child: Align(
|
||||
child: (prodPercentage < 35) ?Text(Main.MinutesToTimeString(unprodActs)) :Container(),
|
||||
alignment: Alignment.center,
|
||||
),
|
||||
width: (100 - prodPercentage) * 1,
|
||||
height: 20,
|
||||
decoration: BoxDecoration(color: Colors.red, borderRadius: BorderRadius.horizontal(right: Radius.circular(10))),
|
||||
),
|
||||
if(prodPercentage >= 35)Text(Main.MinutesToTimeString(unprodActs))
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Text(prodPercentage.toStringAsFixed(1) + "%", style: TextStyle(color: Colors.green, fontWeight: FontWeight.bold, fontSize: 20))
|
||||
],
|
||||
)
|
||||
// CustomPaint(
|
||||
// painter: MyPlayerBar(100, prodPercentage.toInt(),
|
||||
// background: Colors.green, fill: Colors.deepOrange),
|
||||
// child: Container(
|
||||
// alignment: Alignment.center,
|
||||
// height: 25.0,
|
||||
// width: 200,
|
||||
// child: Text(
|
||||
// "Productivity : ${prodPercentage.toStringAsFixed(1)}%",
|
||||
// style: TextStyle(fontWeight: FontWeight.bold),),
|
||||
//
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)
|
||||
// CustomPaint(
|
||||
// painter: MyPlayerBar(100, prodPercentage.toInt(),
|
||||
// background: Colors.green, fill: Colors.deepOrange),
|
||||
// child: Container(
|
||||
// alignment: Alignment.center,
|
||||
// height: 25.0,
|
||||
// width: 200,
|
||||
// child: Text(
|
||||
// "Productivity : ${prodPercentage.toStringAsFixed(1)}%",
|
||||
// style: TextStyle(fontWeight: FontWeight.bold),),
|
||||
//
|
||||
// ),
|
||||
// ),
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user