Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Mobile Computing Group 5
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Hannes Raschke
Mobile Computing Group 5
Commits
7e954f1d
Commit
7e954f1d
authored
2 years ago
by
Florian
Browse files
Options
Downloads
Patches
Plain Diff
app name changed and changes to details view
parent
0ecafa39
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
trackeroo/android/app/src/main/AndroidManifest.xml
+1
-1
1 addition, 1 deletion
trackeroo/android/app/src/main/AndroidManifest.xml
trackeroo/lib/frontend/views/details_view.dart
+145
-117
145 additions, 117 deletions
trackeroo/lib/frontend/views/details_view.dart
with
146 additions
and
118 deletions
trackeroo/android/app/src/main/AndroidManifest.xml
+
1
−
1
View file @
7e954f1d
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.groupfive.trackeroo"
>
<application
android:label=
"
t
rackeroo"
android:label=
"
T
rackeroo"
android:name=
"${applicationName}"
android:icon=
"@mipmap/ic_launcher"
>
<activity
...
...
This diff is collapsed.
Click to expand it.
trackeroo/lib/frontend/views/details_view.dart
+
145
−
117
View file @
7e954f1d
import
'package:flutter/material.dart'
;
import
'package:fl_chart/fl_chart.dart'
;
import
'package:hive_flutter/hive_flutter.dart'
;
import
'package:trackeroo/frontend/utils/transaction_listtile.dart'
;
import
'package:trackeroo/logic/models/transaction.dart'
;
import
'package:trackeroo/logic/services/locator.dart'
;
import
'package:trackeroo/logic/services/transactions_controller.dart'
;
enum
Timespan
{
daily
,
weekly
,
monthly
,
yearly
,
all
}
...
...
@@ -28,32 +31,30 @@ class _DetailsViewState extends State<DetailsView> {
];
Transaction
trn
=
Transaction
(
title:
"Bus Ticket VVS"
,
amount:
-
5.32
,
categoryId:
'food_and_groceries'
,
dueDate:
DateTime
.
now
());
Transaction
trp
=
Transaction
(
title:
"Gehalt"
,
amount:
1300
,
categoryId:
'leisure_and_entertainment'
,
dueDate:
DateTime
.
now
());
Timespan
timespanView
=
Timespan
.
monthly
;
@override
Widget
build
(
BuildContext
context
)
{
return
SingleChildScrollView
(
/* backgroundColor: Colors.blueGrey[900],*/
padding:
const
EdgeInsets
.
all
(
16.0
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
const
Row
(
children:
[
Text
(
'Datails chart'
,
style:
TextStyle
(
fontSize:
14.0
,
fontWeight:
FontWeight
.
bold
),
),
]
),
const
SizedBox
(
height:
20.0
),
mainAxisAlignment:
MainAxisAlignment
.
start
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
const
Row
(
children:
[
Text
(
'Datails chart'
,
style:
TextStyle
(
fontSize:
14.0
,
fontWeight:
FontWeight
.
bold
),
),
]
),
const
SizedBox
(
height:
20.0
),
Center
(
child
:
Container
(
width:
400
,
...
...
@@ -63,49 +64,48 @@ class _DetailsViewState extends State<DetailsView> {
LineChartData
(
borderData:
FlBorderData
(
show:
true
,
border:
Border
.
all
(
width:
0.50
,
color:
const
Color
(
0xff37434d
))
border:
Border
.
symmetric
(
horizontal:
BorderSide
(
color:
Theme
.
of
(
context
)
.
colorScheme
.
onSurface
,
width:
0.5
)
)
),
gridData:
FlGridData
(
show:
true
,
getDrawingHorizontalLine:
(
value
)
{
return
FlLine
(
color:
const
Color
.
fromARGB
(
255
,
163
,
177
,
189
),
strokeWidth:
1
);
},
drawVerticalLine:
true
,
getDrawingVerticalLine:
(
value
){
return
FlLine
(
color:
const
Color
.
fromARGB
(
255
,
163
,
177
,
189
),
strokeWidth:
1
color:
Theme
.
of
(
context
)
.
colorScheme
.
onSurface
,
strokeWidth:
0.5
);
},
drawVerticalLine:
false
,
),
titlesData:
FlTitlesData
(
show:
true
,
rightTitles:
AxisTitles
(
sideTitles:
SideTitles
(
showTitles:
false
),
),
topTitles:
AxisTitles
(
sideTitles:
SideTitles
(
showTitles:
false
)
titlesData:
FlTitlesData
(
show:
true
,
rightTitles:
AxisTitles
(
sideTitles:
SideTitles
(
showTitles:
false
),
),
topTitles:
AxisTitles
(
sideTitles:
SideTitles
(
showTitles:
false
)
),
bottomTitles:
AxisTitles
(
sideTitles:
SideTitles
(
showTitles:
true
,
reservedSize:
30
,
interval:
1
,
),
bottomTitles:
AxisTitles
(
side
Titles:
Side
Titles
(
showTitles:
true
,
reservedSize:
30
,
interval:
1
,
)
,
),
left
Titles:
Axis
Titles
(
sideTitles:
SideTitles
(
showTitles:
true
,
interval:
50
,
reservedSize:
42
,
),
leftTitles:
AxisTitles
(
sideTitles:
SideTitles
(
showTitles:
true
,
interval:
1
,
reservedSize:
42
,
),
),
),
),
maxX:
8
,
maxY:
8
,
maxX:
12
,
maxY:
200
,
minY:
0
,
minX:
0
,
lineBarsData:
[
...
...
@@ -116,84 +116,112 @@ class _DetailsViewState extends State<DetailsView> {
const
FlSpot
(
7
,
6
),
const
FlSpot
(
8
,
4
),
],
isCurved:
true
,
gradient:
LinearGradient
(
colors:
gradientColors
),
barWidth:
5
,
isCurved:
false
,
color:
Colors
.
red
,
barWidth:
3
,
isStrokeCapRound:
true
,
dotData:
FlDotData
(
show:
true
)
dotData:
FlDotData
(
show:
false
)
)
]
)
)
,
)
)
),
const
SizedBox
(
height:
10.0
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
FilterChip
(
onSelected:
(
value
)
=
>
setState
(()
{
timespanView
=
Timespan
.
daily
;
}),
label:
const
Text
(
'Daily'
),
selected:
timespanView
==
Timespan
.
daily
,
showCheckmark:
false
),
FilterChip
(
onSelected:
(
value
)
=
>
setState
(()
{
timespanView
=
Timespan
.
weekly
;
}),
label:
const
Text
(
'Weekly'
),
selected:
timespanView
==
Timespan
.
weekly
,
showCheckmark:
false
const
SizedBox
(
height:
5.0
),
Row
(
children:
[
IconButton
.
filledTonal
(
visualDensity:
VisualDensity
.
compact
,
onPressed:
()
=
>
showModalBottomSheet
(
useSafeArea:
true
,
showDragHandle:
true
,
context:
context
,
builder:
(
context
)
=
>
buildCategoriesModal
(),
),
FilterChip
(
onSelected:
(
value
)
=
>
setState
(()
{
timespanView
=
Timespan
.
monthly
;
}),
label:
const
Text
(
'Montly'
),
selected:
timespanView
==
Timespan
.
monthly
,
showCheckmark:
false
),
FilterChip
(
onSelected:
(
value
)
=
>
setState
(()
{
timespanView
=
Timespan
.
yearly
;
}),
label:
const
Text
(
'Yearly'
),
selected:
timespanView
==
Timespan
.
yearly
,
showCheckmark:
false
icon:
const
Row
(
children:
[
Icon
(
Icons
.
category_rounded
,
size:
14.0
,
),
SizedBox
(
width:
5.0
),
Text
(
'Categories'
)
],
)
),
const
SizedBox
(
width:
10.0
),
IconButton
.
filledTonal
(
visualDensity:
VisualDensity
.
compact
,
onPressed:
()
=
>
showModalBottomSheet
(
context:
context
,
builder:
(
context
)
=
>
buildTimespanModal
(),
),
FilterChip
(
onSelected:
(
value
)
=
>
setState
(()
{
timespanView
=
Timespan
.
all
;
}),
label:
const
Text
(
'All'
),
selected:
timespanView
==
Timespan
.
all
,
showCheckmark:
false
icon:
const
Row
(
children:
[
Icon
(
Icons
.
date_range_rounded
,
size:
14.0
,
),
SizedBox
(
width:
5.0
),
Text
(
'Timespan'
)
],
)
],
),
const
SizedBox
(
height:
20.0
),
const
Text
(
'Transactions'
,
style:
TextStyle
(
fontSize:
14.0
,
fontWeight:
FontWeight
.
bold
),
],
),
const
SizedBox
(
height:
10.0
),
const
Text
(
'Transactions'
,
style:
TextStyle
(
fontSize:
14.0
,
fontWeight:
FontWeight
.
bold
),
const
SizedBox
(
height:
5.0
),
TransactionListtile
(
transaction:
trn
),
TransactionListtile
(
transaction:
trn
),
TransactionListtile
(
transaction:
trn
),
TransactionListtile
(
transaction:
trp
),
TransactionListtile
(
transaction:
trn
),
]
),
const
SizedBox
(
height:
5.0
),
ValueListenableBuilder
(
valueListenable:
locator
.
get
<
TransactionsController
>()
.
transactionsBox
.
listenable
(),
builder:
(
context
,
Box
<
Transaction
>
box
,
child
)
{
List
<
Transaction
>
filteredTransList
=
box
.
values
.
toList
();
filteredTransList
.
sort
((
b
,
a
)
=
>
a
.
createdAt
.
compareTo
(
b
.
createdAt
));
return
ListView
.
builder
(
physics:
const
NeverScrollableScrollPhysics
(),
shrinkWrap:
true
,
itemCount:
filteredTransList
.
length
,
itemBuilder:
(
context
,
index
)
=
>
TransactionListtile
(
transaction:
filteredTransList
[
index
]),
);
},
),
]
),
);
}
Widget
buildCategoriesModal
()
{
return
buildModalScaffold
(
[
const
Text
(
'Choose categories'
,
style:
TextStyle
(
fontSize:
16.0
),
)
]
);
}
Widget
buildTimespanModal
()
{
return
const
SizedBox
();
}
Widget
buildModalScaffold
(
List
<
Widget
>
children
)
{
return
SizedBox
(
width:
double
.
infinity
,
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
children
)
),
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment