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
GitLab 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
715eab40
Commit
715eab40
authored
Jun 19, 2023
by
Florian Schindler
Browse files
Options
Downloads
Patches
Plain Diff
Update transaction_listtile.dart
added modal bottom sheet on tap with details of the transaction
parent
491aeb14
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
trackeroo/lib/frontend/utils/transaction_listtile.dart
+142
-31
142 additions, 31 deletions
trackeroo/lib/frontend/utils/transaction_listtile.dart
with
142 additions
and
31 deletions
trackeroo/lib/frontend/utils/transaction_listtile.dart
+
142
−
31
View file @
715eab40
...
...
@@ -9,11 +9,19 @@ class TransactionListtile extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
return
GestureDetector
(
onTap:
()
=
>
showModalBottomSheet
<
void
>(
showDragHandle:
true
,
context:
context
,
builder:
(
BuildContext
context
)
{
return
buildModalContent
(
transaction
);
},
),
child:
Container
(
padding:
const
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
15.0
),
margin:
const
EdgeInsets
.
only
(
bottom:
5.0
),
decoration:
BoxDecoration
(
color:
Theme
.
of
(
context
)
.
colorScheme
.
secondaryContainer
.
withOpacity
(
0.3
)
,
color:
Theme
.
of
(
context
)
.
colorScheme
.
secondaryContainer
,
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
8.0
))
),
child:
Row
(
...
...
@@ -56,6 +64,109 @@ class TransactionListtile extends StatelessWidget {
),
],
),
),
);
}
Widget
buildModalContent
(
Transaction
transaction
)
{
return
SizedBox
(
width:
double
.
infinity
,
child:
SafeArea
(
child:
Padding
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
20.0
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
transaction
.
title
,
style:
const
TextStyle
(
fontSize:
18.0
,
fontWeight:
FontWeight
.
bold
),
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'
${transaction.createdAt.day}
.
${transaction.createdAt.month}
.
${transaction.createdAt.year}
'
,
style:
const
TextStyle
(
fontSize:
15.0
),
),
Text
(
'
${transaction.createdAt.hour}
:
${transaction.createdAt.minute}
'
,
style:
const
TextStyle
(
fontSize:
15.0
),
)
],
),
const
SizedBox
(
height:
20.0
),
Text
(
'
${transaction.amount.toString()}
€'
,
style:
const
TextStyle
(
fontSize:
40.0
,
fontWeight:
FontWeight
.
w300
),
),
const
SizedBox
(
height:
20.0
),
Container
(
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
15.0
,
vertical:
12.0
),
decoration:
BoxDecoration
(
color:
transaction
.
category
.
color
,
borderRadius:
const
BorderRadius
.
all
(
Radius
.
circular
(
8.0
))
),
child:
Row
(
children:
[
Icon
(
transaction
.
category
.
icon
),
const
SizedBox
(
width:
20.0
),
Text
(
transaction
.
category
.
title
)
],
),
),
const
SizedBox
(
height:
20.0
),
const
Expanded
(
child:
SizedBox
()),
// to be removed when more content is added
Row
(
children:
[
Expanded
(
child:
FilledButton
.
tonal
(
onPressed:
()
=
>
{},
child:
const
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Icon
(
Icons
.
delete_rounded
,
size:
16.0
,
),
SizedBox
(
width:
10.0
),
Text
(
'Delete'
),
],
)
),
),
const
SizedBox
(
width:
10.0
),
Expanded
(
child:
FilledButton
.
tonal
(
onPressed:
()
=
>
{},
child:
const
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Icon
(
Icons
.
edit
,
size:
16.0
,
),
SizedBox
(
width:
10.0
),
Text
(
'Edit'
),
],
)
),
)
],
)
],
),
),
),
);
}
}
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