Journal section added
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:intl/intl.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:tasktracker/Categories.dart';
|
||||
import 'package:tasktracker/Journal.dart';
|
||||
import 'package:tasktracker/Projects.dart';
|
||||
import 'package:tasktracker/Todo.dart';
|
||||
import 'package:tasktracker/Welcome.dart';
|
||||
@@ -111,7 +112,8 @@ class MyApp extends StatelessWidget {
|
||||
'/Categories': (context) => const Categories(),
|
||||
'/Activities': (context) => const Activities(),
|
||||
'/Settings': (context) => const SettingsPage(),
|
||||
'/Projects':(context)=> const Projects()
|
||||
'/Projects':(context)=> const Projects(),
|
||||
'/Journal': (context)=> const JournalPage()
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -283,7 +285,7 @@ class _MyHomePageState extends State<MyHomePage> {
|
||||
ongoingActName = "";
|
||||
}
|
||||
|
||||
if(mounted) {
|
||||
if(this.mounted) {
|
||||
setState(() {
|
||||
|
||||
});
|
||||
@@ -1003,7 +1005,7 @@ Drawer navDrawer(BuildContext context, int pageIndex) {
|
||||
ListTile(
|
||||
selected: (pageIndex == 7),
|
||||
title: Text('Projects'),
|
||||
leading: Icon(Icons.work_outline_sharp, color: Theme.of(context).primaryColor),
|
||||
leading: FaIcon(FontAwesomeIcons.rocket, color: Theme.of(context).primaryColor),
|
||||
onTap: () {
|
||||
if (pageIndex == 7) {
|
||||
return;
|
||||
@@ -1011,6 +1013,17 @@ Drawer navDrawer(BuildContext context, int pageIndex) {
|
||||
Navigator.of(context).pushReplacementNamed('/Projects');
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
selected: (pageIndex == 8),
|
||||
title: Text('Journal'),
|
||||
leading: FaIcon(FontAwesomeIcons.bookJournalWhills, color: Theme.of(context).primaryColor),
|
||||
onTap: () {
|
||||
if (pageIndex == 8) {
|
||||
return;
|
||||
}
|
||||
Navigator.of(context).pushReplacementNamed('/Journal');
|
||||
},
|
||||
),
|
||||
// ListTile(
|
||||
// selected: (pageIndex == 7),
|
||||
// title: Text('TODO'),
|
||||
@@ -1046,37 +1059,6 @@ Drawer navDrawer(BuildContext context, int pageIndex) {
|
||||
));
|
||||
}
|
||||
|
||||
class MyPlayerBar extends CustomPainter {
|
||||
MyPlayerBar(this.max, this.value, {this.background = Colors.lightBlue, this.fill = Colors.blue});
|
||||
|
||||
Color background = Colors.lightBlue;
|
||||
Color fill = Colors.blue;
|
||||
final int max;
|
||||
final int value;
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
Paint paint = Paint();
|
||||
double cursor = (value * size.width) / max;
|
||||
Radius cornerRadius = Radius.circular(10.0);
|
||||
|
||||
// Already played half color (your darker orange)
|
||||
paint.color = background;
|
||||
|
||||
// Painting already played half
|
||||
canvas.drawRRect(RRect.fromRectAndCorners(Rect.fromLTWH(0.0, 0.0, cursor, size.height), topLeft: cornerRadius, bottomLeft: cornerRadius), paint);
|
||||
|
||||
// Yet to play half color (your lighter orange)
|
||||
paint.color = fill;
|
||||
|
||||
// Painting the remaining space
|
||||
canvas.drawRRect(RRect.fromRectAndCorners(Rect.fromLTWH(cursor, 0.0, size.width - cursor, size.height), bottomRight: cornerRadius, topRight: cornerRadius), paint);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(CustomPainter oldDelegate) => true;
|
||||
}
|
||||
|
||||
class CatMapData {
|
||||
CatMapData(this.name, this.time, this.color);
|
||||
final String name;
|
||||
|
||||
Reference in New Issue
Block a user