Google sign in and hourglass improved
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_spinkit/flutter_spinkit.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -25,6 +26,7 @@ import 'User.dart' as User;
|
||||
import 'package:syncfusion_flutter_charts/charts.dart';
|
||||
import 'Dialogs.dart';
|
||||
import 'CustomWidgets.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
final GlobalKey<NavigatorState> navigatorKey = new GlobalKey<NavigatorState>();
|
||||
showAlertDialog(BuildContext context, String title, String message) {
|
||||
// set up the button
|
||||
@@ -72,7 +74,8 @@ extension HexColor on Color {
|
||||
|
||||
void main() async {
|
||||
//Wakelock.enable(); // or Wakelock.toggle(on: true);
|
||||
// WidgetsFlutterBinding.ensureInitialized();
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp();
|
||||
//
|
||||
// ByteData data = await PlatformAssetBundle().load('assets/ca/certificate.crt');
|
||||
// SecurityContext.defaultContext.setTrustedCertificatesBytes(data.buffer.asUint8List());
|
||||
@@ -200,13 +203,17 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
print('hourglass time : $hourglassTime');
|
||||
hourglassColors =[];
|
||||
hourglassStops = [];
|
||||
int testHourglasstime = 0;
|
||||
hourglassTotalTime=0;
|
||||
hourglassCatData.forEach((element) {
|
||||
if(element.time > hourglassTotalTime){
|
||||
hourglassTotalTime=element.time;
|
||||
}
|
||||
});
|
||||
hourglassCatData.forEach((element) {
|
||||
hourglassColors.add(element.color);
|
||||
hourglassStops.add(element.time/hourglassTotalTime);
|
||||
testHourglasstime += element.time;
|
||||
});
|
||||
print('$testHourglasstime : $hourglassTotalTime');
|
||||
print('maxT: $hourglassTotalTime');
|
||||
if(hourglassColors.isEmpty){
|
||||
hourglassColors.add(Colors.black);
|
||||
hourglassStops.add(1);
|
||||
@@ -282,7 +289,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
Map<TaskType, int> taskTypesDuration = <TaskType, int>{};
|
||||
hourglassCatData=[];
|
||||
hourglassColors=[];
|
||||
hourglassTotalTime=0;
|
||||
firstDay = null;
|
||||
lastDay = null;
|
||||
String lastDate = "";
|
||||
@@ -355,9 +361,6 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
} else {
|
||||
catTimeMap.putIfAbsent(element.taskType.cat!, () => thisMinutes);
|
||||
}
|
||||
if(thisMinutes > hourglassTotalTime){
|
||||
hourglassTotalTime=thisMinutes;
|
||||
}
|
||||
}
|
||||
|
||||
if ((element.startTime.isAfter(catsRange!.start) && element.startTime.isBefore(catsRange!.end)) ||
|
||||
@@ -385,6 +388,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
if(hourglassCatData[i].name == element.taskType.category){
|
||||
existingEntryIndex=i;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (existingEntryIndex==null) {
|
||||
@@ -392,6 +397,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
} else {
|
||||
hourglassCatData[existingEntryIndex!].time+=thisMinutes;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
hourglassCatData.sort((a, b) => a.time.compareTo(b.time));
|
||||
@@ -452,6 +458,8 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
print('prodData : $productivityData');
|
||||
// loadingStats=false;
|
||||
}
|
||||
|
||||
@@ -484,7 +492,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(children: [Icon(Icons.article_outlined, color: Theme.of(context).primaryColor), SizedBox(width: 10), Text('Summary')]),
|
||||
Row(children: [FaIcon(FontAwesomeIcons.chartBar), SizedBox(width: 10), Text('Summary')]),
|
||||
Row(
|
||||
children: [
|
||||
(User.offline)
|
||||
|
||||
Reference in New Issue
Block a user