Static Nav Drawer in landscape
This commit is contained in:
@@ -72,6 +72,7 @@ class _ActivitiesState extends State<Activities> {
|
||||
// progressDialog = ProgressDialog(context: context);
|
||||
// List<Widget> activities = PrintTasks();
|
||||
activitiesGroups = PrintTasks();
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -172,25 +173,34 @@ class _ActivitiesState extends State<Activities> {
|
||||
),
|
||||
],
|
||||
)),
|
||||
drawer: Main.navDrawer(context, 2),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(0),
|
||||
child: ScrollablePositionedList.builder(
|
||||
itemScrollController: scrollController,
|
||||
itemCount: activitiesGroups.length,
|
||||
itemBuilder: (context, index) {
|
||||
// return activities[index];
|
||||
return StickyHeader(
|
||||
header: activitiesGroups.values.toList()[index].dateSeperator,
|
||||
content: Column(
|
||||
children: activitiesGroups.values.toList()[index].activities,
|
||||
));
|
||||
})
|
||||
// SingleChildScrollView(
|
||||
// child: Column(
|
||||
// children: PrintTasks(),
|
||||
// ))
|
||||
));
|
||||
drawer: landscape ? null : Main.navDrawer(context, 2),
|
||||
body: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
landscape?Main.navDrawer(context, 2) : Container(),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(0),
|
||||
child: ScrollablePositionedList.builder(
|
||||
itemScrollController: scrollController,
|
||||
itemCount: activitiesGroups.length,
|
||||
itemBuilder: (context, index) {
|
||||
// return activities[index];
|
||||
return StickyHeader(
|
||||
header: activitiesGroups.values.toList()[index].dateSeperator,
|
||||
content: Column(
|
||||
children: activitiesGroups.values.toList()[index].activities,
|
||||
));
|
||||
})
|
||||
// SingleChildScrollView(
|
||||
// child: Column(
|
||||
// children: PrintTasks(),
|
||||
// ))
|
||||
),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
DateFormat dFormat = DateFormat("yyyy-MM-dd");
|
||||
|
||||
@@ -44,65 +44,78 @@ class _AnalyticsPageState extends State<AnalyticsPage> {
|
||||
// for (var value in avgActs) {
|
||||
// Debug.LogResponse('${value.taskType.name} : ${DateFormat('HH:mm').format(value.startTime)} - ${DateFormat('HH:mm').format(value.endTime)}');
|
||||
// }
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Row(
|
||||
children: [FaIcon(FontAwesomeIcons.chartLine),SizedBox(width: 15,), Text("Analytics")],
|
||||
)),
|
||||
drawer: navDrawer(context, 1),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
child:Column(
|
||||
children: [
|
||||
Card(
|
||||
drawer: landscape ? null : navDrawer(context, 1),
|
||||
body: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
landscape?navDrawer(context, 1) : Container(),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 5),
|
||||
child: Column(
|
||||
padding: EdgeInsets.all(8),
|
||||
child:Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Average Day',style: TextStyle(fontSize: 17)),
|
||||
MaterialButton(
|
||||
|
||||
color: Colors.green,
|
||||
onPressed: (){
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context)=> AvgDayPage()));
|
||||
},
|
||||
child: Text('More...'),
|
||||
)
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Container(
|
||||
height: 400,
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: (!days.isEmpty)
|
||||
? Column(
|
||||
Card(
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 5),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text('Average Day',style: TextStyle(fontSize: 17)),
|
||||
MaterialButton(
|
||||
|
||||
Expanded(
|
||||
child: SfCircularChart(legend: Legend(isVisible: true,position: LegendPosition.bottom,overflowMode: LegendItemOverflowMode.wrap), series: <CircularSeries>[
|
||||
// Render pie chart
|
||||
PieSeries<CatMapData, String>(
|
||||
dataSource: avgDayData,
|
||||
pointColorMapper: (CatMapData data, _) => data.color,
|
||||
xValueMapper: (CatMapData data, _) => data.name,
|
||||
yValueMapper: (CatMapData data, _) => data.time,
|
||||
dataLabelMapper: (CatMapData sales, _) => MinutesToTimeString(sales.time),
|
||||
dataLabelSettings: DataLabelSettings(isVisible: true, useSeriesColor: true, overflowMode: OverflowMode.shift, showZeroValue: false))
|
||||
]))
|
||||
color: Colors.green,
|
||||
onPressed: (){
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context)=> AvgDayPage()));
|
||||
},
|
||||
child: Text('More...'),
|
||||
)
|
||||
],
|
||||
)
|
||||
: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [CircularProgressIndicator()]))),
|
||||
),
|
||||
Divider(),
|
||||
Container(
|
||||
height: 400,
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: (!days.isEmpty)
|
||||
? Column(
|
||||
children: [
|
||||
|
||||
Expanded(
|
||||
child: SfCircularChart(legend: Legend(isVisible: true,position: LegendPosition.bottom,overflowMode: LegendItemOverflowMode.wrap), series: <CircularSeries>[
|
||||
// Render pie chart
|
||||
PieSeries<CatMapData, String>(
|
||||
dataSource: avgDayData,
|
||||
pointColorMapper: (CatMapData data, _) => data.color,
|
||||
xValueMapper: (CatMapData data, _) => data.name,
|
||||
yValueMapper: (CatMapData data, _) => data.time,
|
||||
dataLabelMapper: (CatMapData sales, _) => MinutesToTimeString(sales.time),
|
||||
dataLabelSettings: DataLabelSettings(isVisible: true, useSeriesColor: true, overflowMode: OverflowMode.shift, showZeroValue: false))
|
||||
]))
|
||||
],
|
||||
)
|
||||
: Row(mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.center, children: [CircularProgressIndicator()]))),
|
||||
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
)
|
||||
],
|
||||
)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@ class _CategoriesState extends State<Categories> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -60,13 +62,22 @@ class _CategoriesState extends State<Categories> {
|
||||
]) : Container(),
|
||||
],
|
||||
)),
|
||||
drawer: navDrawer(context, 4),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: PrintCats(),
|
||||
))));
|
||||
drawer: landscape ? null : navDrawer(context, 4),
|
||||
body: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
landscape?navDrawer(context, 4) : Container(),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: PrintCats(),
|
||||
))),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
void UpdateList() async {
|
||||
|
||||
234
lib/Journal.dart
234
lib/Journal.dart
@@ -44,6 +44,7 @@ class _JournalPageState extends State<JournalPage>{
|
||||
FocusNode _focus = FocusNode();
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -131,125 +132,134 @@ class _JournalPageState extends State<JournalPage>{
|
||||
],
|
||||
),
|
||||
),
|
||||
drawer: navDrawer(context, 8),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: ScrollablePositionedList.builder(
|
||||
itemCount: User.journal.length,
|
||||
itemBuilder: (context, index) {
|
||||
int charCount = '\n'.allMatches(User.journal[index].description ?? '').length * 50;
|
||||
charCount +=(User.journal[index].description ?? '').length;
|
||||
int maxCharCount = 100;
|
||||
drawer: landscape ? null : navDrawer(context, 8),
|
||||
body: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
landscape?navDrawer(context, 8) : Container(),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: ScrollablePositionedList.builder(
|
||||
itemCount: User.journal.length,
|
||||
itemBuilder: (context, index) {
|
||||
int charCount = '\n'.allMatches(User.journal[index].description ?? '').length * 50;
|
||||
charCount +=(User.journal[index].description ?? '').length;
|
||||
int maxCharCount = 100;
|
||||
|
||||
bool matchesSearch = false;
|
||||
if(searching && searchController.text.isNotEmpty){
|
||||
if(User.journal[index].title != null && User.journal[index].title!.toLowerCase().contains(searchController.text.toLowerCase())){
|
||||
matchesSearch = true;
|
||||
}
|
||||
if((User.journal[index].description ?? '').toLowerCase().contains(searchController.text.toLowerCase())){
|
||||
matchesSearch=true;
|
||||
}
|
||||
}else{
|
||||
matchesSearch =true;
|
||||
}
|
||||
|
||||
return (matchesSearch) ? Container(
|
||||
child: InkWell(
|
||||
onTap: (){
|
||||
if(selecting){
|
||||
if(selectedIndexes.contains(index)){
|
||||
selectedIndexes.remove(index);
|
||||
}else{
|
||||
selectedIndexes.add(index);
|
||||
}
|
||||
setState(() {
|
||||
|
||||
});
|
||||
}else{
|
||||
if(expandedIndex==index){
|
||||
expandedIndex=-1;
|
||||
//_controller..reverse(from: 0.5);
|
||||
}else {
|
||||
expandedIndex = index;
|
||||
// _controller..forward(from: 0);
|
||||
}
|
||||
setState(() {
|
||||
|
||||
});
|
||||
bool matchesSearch = false;
|
||||
if(searching && searchController.text.isNotEmpty){
|
||||
if(User.journal[index].title != null && User.journal[index].title!.toLowerCase().contains(searchController.text.toLowerCase())){
|
||||
matchesSearch = true;
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
selecting = !selecting;
|
||||
if(!selectedIndexes.contains(index)){selectedIndexes.add(index);}
|
||||
setState(() {});
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
if (selecting)
|
||||
Checkbox(
|
||||
value: selectedIndexes.contains(index),
|
||||
onChanged: (newVal) {
|
||||
if(selectedIndexes.contains(index)){
|
||||
selectedIndexes.remove(index);
|
||||
}else{
|
||||
selectedIndexes.add(index);
|
||||
}
|
||||
setState(() {
|
||||
if((User.journal[index].description ?? '').toLowerCase().contains(searchController.text.toLowerCase())){
|
||||
matchesSearch=true;
|
||||
}
|
||||
}else{
|
||||
matchesSearch =true;
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(seconds: 1),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
(User.journal[index].title!=null && User.journal[index].title!.isNotEmpty) ?
|
||||
Text(User.journal[index].title!, style: TextStyle(fontSize: 18)) :
|
||||
Text(DateFormat('MMMM-dd').format( User.journal[index].day), style: TextStyle(fontSize: 18)),
|
||||
Container(padding:EdgeInsets.symmetric(horizontal: 10,vertical: 2),decoration: BoxDecoration(borderRadius: BorderRadius.circular(20),color: Colors.black26),child: Text(DateFormat('yyyy-MM-dd').format(User.journal[index].day)))
|
||||
],
|
||||
),
|
||||
SizedBox(height: 5,),
|
||||
if (User.journal[index].description != null && User.journal[index].description!.isNotEmpty)
|
||||
(charCount > maxCharCount && expandedIndex != index) ?
|
||||
Text(User.journal[index].description!.substring(0,maxCharCount.clamp(0,User.journal[index].description!.length)) + '...') :
|
||||
Text(User.journal[index].description!),
|
||||
return (matchesSearch) ? Container(
|
||||
child: InkWell(
|
||||
onTap: (){
|
||||
if(selecting){
|
||||
if(selectedIndexes.contains(index)){
|
||||
selectedIndexes.remove(index);
|
||||
}else{
|
||||
selectedIndexes.add(index);
|
||||
}
|
||||
setState(() {
|
||||
|
||||
if(charCount>maxCharCount) Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(),
|
||||
(index == expandedIndex)? Icon(Icons.keyboard_arrow_up) : Icon(Icons.keyboard_arrow_down)
|
||||
});
|
||||
}else{
|
||||
if(expandedIndex==index){
|
||||
expandedIndex=-1;
|
||||
//_controller..reverse(from: 0.5);
|
||||
}else {
|
||||
expandedIndex = index;
|
||||
// _controller..forward(from: 0);
|
||||
}
|
||||
setState(() {
|
||||
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if(selecting)InkWell(onTap:(){
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => NewJournal(date: User.journal[index].day, title: User.journal[index].title, text: User.journal[index].description,))).then((val) {
|
||||
});
|
||||
}
|
||||
},
|
||||
onLongPress: () {
|
||||
selecting = !selecting;
|
||||
if(!selectedIndexes.contains(index)){selectedIndexes.add(index);}
|
||||
setState(() {});
|
||||
});
|
||||
selecting=false;
|
||||
setState(() {
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
if (selecting)
|
||||
Checkbox(
|
||||
value: selectedIndexes.contains(index),
|
||||
onChanged: (newVal) {
|
||||
if(selectedIndexes.contains(index)){
|
||||
selectedIndexes.remove(index);
|
||||
}else{
|
||||
selectedIndexes.add(index);
|
||||
}
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},child: Container(margin:EdgeInsets.all(8),child: FaIcon(FontAwesomeIcons.edit)))
|
||||
],
|
||||
),
|
||||
)) : Container();
|
||||
}),
|
||||
});
|
||||
},
|
||||
),
|
||||
Expanded(
|
||||
child: Card(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(seconds: 1),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
(User.journal[index].title!=null && User.journal[index].title!.isNotEmpty) ?
|
||||
Text(User.journal[index].title!, style: TextStyle(fontSize: 18)) :
|
||||
Text(DateFormat('MMMM-dd').format( User.journal[index].day), style: TextStyle(fontSize: 18)),
|
||||
Container(padding:EdgeInsets.symmetric(horizontal: 10,vertical: 2),decoration: BoxDecoration(borderRadius: BorderRadius.circular(20),color: Colors.black26),child: Text(DateFormat('yyyy-MM-dd').format(User.journal[index].day)))
|
||||
],
|
||||
),
|
||||
SizedBox(height: 5,),
|
||||
if (User.journal[index].description != null && User.journal[index].description!.isNotEmpty)
|
||||
(charCount > maxCharCount && expandedIndex != index) ?
|
||||
Text(User.journal[index].description!.substring(0,maxCharCount.clamp(0,User.journal[index].description!.length)) + '...') :
|
||||
Text(User.journal[index].description!),
|
||||
|
||||
if(charCount>maxCharCount) Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(),
|
||||
(index == expandedIndex)? Icon(Icons.keyboard_arrow_up) : Icon(Icons.keyboard_arrow_down)
|
||||
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if(selecting)InkWell(onTap:(){
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => NewJournal(date: User.journal[index].day, title: User.journal[index].title, text: User.journal[index].description,))).then((val) {
|
||||
setState(() {});
|
||||
});
|
||||
selecting=false;
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},child: Container(margin:EdgeInsets.all(8),child: FaIcon(FontAwesomeIcons.edit)))
|
||||
],
|
||||
),
|
||||
)) : Container();
|
||||
}),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -61,6 +61,12 @@ class _ProjectDetailsState extends State<ProjectDetails> {
|
||||
if (withinRange) {
|
||||
|
||||
if (lastDay != element.startTime.day) {
|
||||
if(element.startTime.day - lastDay > 1 && lastDay!=-1){
|
||||
for(int i =1; i < element.startTime.day - lastDay; i++){
|
||||
timeProgressionData.add(ProjectChartData(justDate(element.startTime.subtract(Duration(days: i))), totalTimeSpent));
|
||||
timeSpentData.add(ProjectChartData(justDate(element.startTime.subtract(Duration(days: i))), 0));
|
||||
}
|
||||
}
|
||||
if (totalTimeSpent > 0) {
|
||||
timeProgressionData.add(ProjectChartData(justDate(element.startTime), totalTimeSpent));
|
||||
}
|
||||
@@ -82,7 +88,7 @@ class _ProjectDetailsState extends State<ProjectDetails> {
|
||||
int stepsCompleted = 1;
|
||||
stepsProgressionData=[];
|
||||
|
||||
stepsProgressionData.add(ProjectChartData(timeProgressionData[0]!.day,0));
|
||||
if(stepsProgressionData.isNotEmpty)stepsProgressionData.add(ProjectChartData(timeProgressionData[0].day,0));
|
||||
|
||||
for(int i =0; i < steps.length; i++){
|
||||
if(steps[i].finishedDate==null){continue;}
|
||||
|
||||
@@ -44,6 +44,7 @@ class _ProjectsState extends State<Projects> {
|
||||
int selectedPage = 0;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
return SafeArea(child: Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -97,106 +98,128 @@ class _ProjectsState extends State<Projects> {
|
||||
//Container(color: Colors.red,child: Text("Offline",style:TextStyle(fontSize: 5))),
|
||||
],
|
||||
)),
|
||||
drawer: navDrawer(context, 7),
|
||||
drawer: landscape ? null : navDrawer(context, 7),
|
||||
body:
|
||||
(User.projects.isEmpty)? Container(child: Image.asset(('images/project.png'),color: Colors.white.withOpacity(0.6), colorBlendMode: BlendMode.modulate,)) :
|
||||
(selectedPage == 0) ?
|
||||
Container(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Card(child:
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
FaIcon(FontAwesomeIcons.cogs, color: Colors.yellow),
|
||||
SizedBox(width: 15,),
|
||||
Text('Active Projects (${User.projects.length})',style:TextStyle(fontSize: 18)),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Container(
|
||||
height: 200,
|
||||
child: ListView.builder(
|
||||
itemCount: User.projects.length,
|
||||
itemBuilder: (context,index){
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context)=> ProjectDetails(project: User.projects[index],)));
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(10)),
|
||||
padding:EdgeInsets.all(8),
|
||||
margin: EdgeInsets.all(1),
|
||||
child:
|
||||
Row(mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(flex:3,child: Text(User.projects[index].name)),
|
||||
Expanded(flex:2,child: Text('20% [200h]')),
|
||||
Expanded(
|
||||
flex:2,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: User.projects[index].cat!.productive ? Colors.green : Colors.redAccent,
|
||||
),
|
||||
padding:EdgeInsets.symmetric(horizontal: 8),
|
||||
child:Text(User.projects[index].cat!.name)
|
||||
Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
landscape?navDrawer(context, 7) : Container(),
|
||||
Expanded(
|
||||
child: (User.projects.isEmpty)? Container(child: Image.asset(('images/project.png'),color: Colors.white.withOpacity(0.6), colorBlendMode: BlendMode.modulate,)) :
|
||||
(selectedPage == 0) ?
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(15),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Card(child:
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
FaIcon(FontAwesomeIcons.cogs, color: Colors.yellow),
|
||||
SizedBox(width: 15,),
|
||||
Text('Active Projects (${User.projects.length})',style:TextStyle(fontSize: 18)),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Container(
|
||||
height: 200,
|
||||
child: ListView.builder(
|
||||
itemCount: User.projects.length,
|
||||
itemBuilder: (context,index){
|
||||
int progress = 0;
|
||||
for (var value in User.projects[index].steps) {
|
||||
if(value.finishedDate!=null){
|
||||
progress += value.progress;
|
||||
}
|
||||
}
|
||||
|
||||
return InkWell(
|
||||
onTap: (){
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context)=> ProjectDetails(project: User.projects[index],)));
|
||||
},
|
||||
child: Container(
|
||||
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(10)),
|
||||
padding:EdgeInsets.all(8),
|
||||
margin: EdgeInsets.all(1),
|
||||
child:
|
||||
Row(mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Expanded(flex:3,child: Text(User.projects[index].name)),
|
||||
Expanded(flex:2,child: Text('$progress%')),
|
||||
Expanded(
|
||||
flex:2,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
color: User.projects[index].cat!.productive ? Colors.green : Colors.redAccent,
|
||||
),
|
||||
padding:EdgeInsets.symmetric(horizontal: 8),
|
||||
child:Text(User.projects[index].cat!.name)
|
||||
)
|
||||
],),
|
||||
)
|
||||
],
|
||||
)
|
||||
],),
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
)
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
)),
|
||||
SizedBox(height: 30,),
|
||||
Card(child:
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
],
|
||||
),
|
||||
)),
|
||||
SizedBox(height: 30,),
|
||||
Card(child:
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
FaIcon(FontAwesomeIcons.check,color: Colors.green,),
|
||||
SizedBox(width: 15,),
|
||||
Text('Finished Projects (0)',style:TextStyle(fontSize: 18)),
|
||||
],
|
||||
),
|
||||
Divider(),
|
||||
Container(
|
||||
height: 50,
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
)),
|
||||
)
|
||||
:
|
||||
SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
FaIcon(FontAwesomeIcons.check,color: Colors.green,),
|
||||
SizedBox(width: 15,),
|
||||
Text('Finished Projects (0)',style:TextStyle(fontSize: 18)),
|
||||
],
|
||||
Column(
|
||||
children: printProjects(),
|
||||
),
|
||||
Divider(),
|
||||
Container(
|
||||
height: 50,
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
))
|
||||
:
|
||||
Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Column(
|
||||
children: [
|
||||
Column(
|
||||
children: printProjects(),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:tasktracker/Settings/Settings.dart';
|
||||
import 'package:tasktracker/Data.dart';
|
||||
|
||||
@@ -26,8 +27,11 @@ class _BehaviourSettingsState extends State<BehaviourSettings> {
|
||||
});
|
||||
}
|
||||
|
||||
TextEditingController untrackedGapSettings = TextEditingController();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
int untrackedGapValue = int.tryParse(untrackedGapSettings.text) ?? 1;
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text('Behaviour Settings')),
|
||||
body: SafeArea(
|
||||
@@ -47,6 +51,45 @@ class _BehaviourSettingsState extends State<BehaviourSettings> {
|
||||
});
|
||||
}),
|
||||
),
|
||||
//TODO
|
||||
ListTile(
|
||||
title:Text("Untracked Delay Threshold"),
|
||||
subtitle: Text("Makes it easier to fill in the gaps"),
|
||||
trailing:
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
if(untrackedGapValue> 0)InkWell(onTap: (){
|
||||
untrackedGapSettings.text = (untrackedGapValue-1).toString();
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
child : Container(margin: EdgeInsets.all(10),child: Text('-')),),
|
||||
SizedBox(
|
||||
width: 25,
|
||||
height: 30,
|
||||
child: TextField(
|
||||
textAlign: TextAlign.center,
|
||||
controller: untrackedGapSettings,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: <TextInputFormatter>[
|
||||
FilteringTextInputFormatter.digitsOnly
|
||||
],),
|
||||
),
|
||||
|
||||
InkWell(onTap: (){
|
||||
untrackedGapSettings.text = (untrackedGapValue+1).toString();
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
child: Container(margin:EdgeInsets.all(10),child: Text('+')),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
|
||||
],
|
||||
)
|
||||
|
||||
@@ -44,6 +44,8 @@ class _TasksState extends State<Tasks> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -82,13 +84,22 @@ class _TasksState extends State<Tasks> {
|
||||
: Container(),
|
||||
],
|
||||
)),
|
||||
drawer: navDrawer(context, 3),
|
||||
body: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: PrintTasks(),
|
||||
))));
|
||||
drawer: landscape ? null : navDrawer(context, 3),
|
||||
body: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
landscape?navDrawer(context, 3) : Container(),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(10),
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: PrintTasks(),
|
||||
))),
|
||||
),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
void UpdateList() async {
|
||||
|
||||
171
lib/Todos.dart
171
lib/Todos.dart
@@ -68,6 +68,7 @@ class _TodosPageState extends State<TodosPage> {
|
||||
simpleTodos.add(todo);
|
||||
}
|
||||
}
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -121,112 +122,122 @@ class _TodosPageState extends State<TodosPage> {
|
||||
],
|
||||
),
|
||||
),
|
||||
drawer: navDrawer(context, 9),
|
||||
body: SingleChildScrollView(
|
||||
// margin: EdgeInsets.fromLTRB(2, 10, 0, 10),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(10)),
|
||||
child: (projects.length <=0) ?Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
drawer: landscape ? null : navDrawer(context, 9),
|
||||
body: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
landscape?navDrawer(context, 9) : Container(),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
// margin: EdgeInsets.fromLTRB(2, 10, 0, 10),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text('No Todos Related to Projects'),
|
||||
],
|
||||
) :ScrollablePositionedList.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: projects.length,
|
||||
itemBuilder: (context, i) {
|
||||
String thisProject= projects.keys.toList()[i];
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 8),
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(10)),
|
||||
child: (projects.length <=0) ?Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text('No Todos Related to Projects'),
|
||||
],
|
||||
) :ScrollablePositionedList.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: projects.length,
|
||||
itemBuilder: (context, i) {
|
||||
String thisProject= projects.keys.toList()[i];
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 0,vertical: 8),
|
||||
child: Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: (){
|
||||
if(expandedProjects.contains(thisProject)){
|
||||
expandedProjects.remove(thisProject);
|
||||
}else{
|
||||
expandedProjects.add(thisProject);
|
||||
|
||||
}
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon((!expandedProjects.contains(thisProject)) ? Icons.keyboard_arrow_right_outlined : Icons.keyboard_arrow_down_outlined),
|
||||
Text('${projects.keys.toList()[i]} (${projects.values.toList()[i].length})',style: TextStyle(fontSize: 18)),
|
||||
],
|
||||
),
|
||||
Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
if(expandedProjects.contains(thisProject))Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
|
||||
child: ScrollablePositionedList.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: projects.values.toList()[i].length,
|
||||
itemBuilder: (context, index) {
|
||||
int maxCharCount = 100;
|
||||
Todo todo = projects.values.toList()[i][index];
|
||||
|
||||
print('$i : $index');
|
||||
return todoCard(todo);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(15)),
|
||||
child: Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: (){
|
||||
if(expandedProjects.contains(thisProject)){
|
||||
expandedProjects.remove(thisProject);
|
||||
}else{
|
||||
expandedProjects.add(thisProject);
|
||||
onTap: (){expandedSimpleTodos=!expandedSimpleTodos;setState(() {
|
||||
|
||||
}
|
||||
setState(() {
|
||||
|
||||
});
|
||||
},
|
||||
});},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon((!expandedProjects.contains(thisProject)) ? Icons.keyboard_arrow_right_outlined : Icons.keyboard_arrow_down_outlined),
|
||||
Text('${projects.keys.toList()[i]} (${projects.values.toList()[i].length})',style: TextStyle(fontSize: 18)),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Icon((!expandedSimpleTodos) ? Icons.keyboard_arrow_right_outlined : Icons.keyboard_arrow_down_outlined),
|
||||
Text('Typical Todos (${simpleTodos.length})',style: TextStyle(fontSize: 18)),
|
||||
],
|
||||
),
|
||||
Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
if(expandedProjects.contains(thisProject))Container(
|
||||
if(expandedSimpleTodos)Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
|
||||
child: ScrollablePositionedList.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: projects.values.toList()[i].length,
|
||||
itemCount: simpleTodos.length,
|
||||
itemBuilder: (context, index) {
|
||||
int maxCharCount = 100;
|
||||
Todo todo = projects.values.toList()[i][index];
|
||||
|
||||
print('$i : $index');
|
||||
Todo todo = simpleTodos[index];
|
||||
return todoCard(todo);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.all(8),
|
||||
padding: EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(color: Colors.black26, borderRadius: BorderRadius.circular(15)),
|
||||
child: Column(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: (){expandedSimpleTodos=!expandedSimpleTodos;setState(() {
|
||||
|
||||
});},
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon((!expandedSimpleTodos) ? Icons.keyboard_arrow_right_outlined : Icons.keyboard_arrow_down_outlined),
|
||||
Text('Typical Todos (${simpleTodos.length})',style: TextStyle(fontSize: 18)),
|
||||
],
|
||||
),
|
||||
Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
if(expandedSimpleTodos)Container(
|
||||
padding: EdgeInsets.fromLTRB(8, 0, 8, 0),
|
||||
child: ScrollablePositionedList.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: simpleTodos.length,
|
||||
itemBuilder: (context, index) {
|
||||
int maxCharCount = 100;
|
||||
Todo todo = simpleTodos[index];
|
||||
return todoCard(todo);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1325,10 +1325,12 @@ class UserOperations {
|
||||
|
||||
await cacheDb.insert('Queries', query);
|
||||
|
||||
//TODO
|
||||
//update Cache
|
||||
// Map<String, Object> data = {Activity.colType: username + type, Activity.colStartTime: dFormat.format(sTime), Activity.colEndTime: dFormat.format(eTime), Activity.colMetadata: metadata};
|
||||
// String updateActQuery = "UPDATE Activities SET ${Activity.colType}=";
|
||||
// await cacheDb.insert('Activities', data);
|
||||
await cacheDb.rawUpdate("UPDATE Activities SET ${Activity.colType}='${username + type}', ${Activity.colStartTime}=datetime('${dFormat.format(sTime)}'), ${Activity.colEndTime}=datetime('${dFormat.format(eTime)}'), ${Activity.colMetadata}='$metadata' WHERE ${Activity.colStartTime}=datetime('${dFormat.format(init_sTime)}')");
|
||||
await refreshUserData(forceOffline: true);
|
||||
} else {
|
||||
// queries.add(Queries('edit_activity', jsonEncode(queryBody)));
|
||||
|
||||
@@ -565,6 +565,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
|
||||
avgProd = avgProd / _avgProdCount;
|
||||
pastAvgProd = pastAvgProd / _pastAvgProdCount;
|
||||
bool landscape=((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1);
|
||||
return Scaffold(
|
||||
floatingActionButton: FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
@@ -602,13 +603,13 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
//Container(color: Colors.red,child: Text("Offline",style:TextStyle(fontSize: 5))),
|
||||
],
|
||||
)),
|
||||
drawer: navDrawer(context, 0),
|
||||
drawer: landscape ? null : navDrawer(context, 0),
|
||||
body: SafeArea(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
((MediaQuery.of(context).size.width / MediaQuery.of(context).size.height) > 1) ?navDrawer(context, 0) : Container(),
|
||||
landscape?navDrawer(context, 0) : Container(),
|
||||
(User.activities.isEmpty) ? Container(
|
||||
width: 1000,
|
||||
child: Column(
|
||||
|
||||
Reference in New Issue
Block a user