Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
IT Project 2020
Group B
pilar-mobile
Commits
af299c49
Commit
af299c49
authored
Dec 26, 2020
by
Tsamara Esperanti Erwin
Browse files
[GREEN] Add dialog for goods donation detail info
parent
cb495b75
Pipeline
#62150
passed with stages
in 8 minutes and 6 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/Pages/DonationHistory/donation_history.dart
View file @
af299c49
...
...
@@ -117,7 +117,7 @@ class __MyDonationsState extends State<_MyDonations> {
?
const
Center
(
child:
CustomCircularIndicator
(),
)
:
_Donation
ListItem
(
:
_
Card
Donation
(
donation:
state
.
donations
[
index
],
);
}));
...
...
@@ -129,6 +129,68 @@ class __MyDonationsState extends State<_MyDonations> {
}
}
class
_CardDonation
extends
StatelessWidget
{
const
_CardDonation
({
Key
key
,
@required
this
.
donation
,
})
:
super
(
key:
key
);
final
Donation
donation
;
@override
Widget
build
(
BuildContext
context
)
{
if
(
donation
.
donationType
==
'CSH'
)
{
return
_DonationListItem
(
donation:
donation
,
);
}
else
{
return
GestureDetector
(
onTap:
()
{
showDialog
(
context:
context
,
builder:
(
BuildContext
context
)
=
>
_DonationDetaiDialog
(
donation:
donation
,));
},
child:
_DonationListItem
(
donation:
donation
,
),
);
}
}
}
class
_DonationDetaiDialog
extends
StatelessWidget
{
final
Donation
donation
;
const
_DonationDetaiDialog
({
Key
key
,
@required
this
.
donation
,
})
:
super
(
key:
key
);
@override
Widget
build
(
BuildContext
context
)
{
return
Dialog
(
child:
Container
(
height:
100
,
margin:
const
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
12.0
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
GestureDetector
(
onTap:
()
{
Navigator
.
pop
(
context
);
},
child:
Wrap
(
children:
[
const
Icon
(
Icons
.
clear
,
size:
22.0
,
key:
Key
(
'clear-icon'
),),
Text
(
'Detail Donasi -
${donation.donationNumber}
'
,
style:
TextStyle
(
fontSize:
16.0
,
height:
1.3
,
fontWeight:
FontWeight
.
bold
),)
],),
),
const
SizedBox
(
height:
10.0
,),
Text
(
'Barang:
${donation.goodsDescription}
'
),
Text
(
'Jumlah:
${donation.goodsQuantity}
'
),
],
),
),
);
}
}
class
_DonationListItem
extends
StatelessWidget
{
const
_DonationListItem
({
Key
key
,
...
...
@@ -256,3 +318,4 @@ class _DonationListItem extends StatelessWidget {
);
}
}
test/my_donations_test.dart
View file @
af299c49
...
...
@@ -136,37 +136,37 @@ void main() {
(
_
)
async
=
>
Response
<
Map
<
String
,
dynamic
>>(
statusCode:
200
,
data:
{
"
count
"
:
1
,
"
next
"
:
"
ada
"
,
"
previous
"
:
null
,
"
results
"
:
[
'
count
'
:
1
,
'
next
'
:
'
ada
'
,
'
previous
'
:
null
,
'
results
'
:
[
{
"
id
"
:
"
5b0a405c-a5a2-415e-9788-2b52c50792b1
"
,
"
donation_number
"
:
"
8DVQQ6
"
,
"
program
"
:
"
b02580b3-d1ab-4bf8-b4c3-87a340ed3319
"
,
"
program_code
"
:
"
5GZW45
"
,
"
user
"
:
"
f26c3bcd-f9d3-469e-b466-57610d9acdcb
"
,
"
user_username
"
:
"
sarah
"
,
"
user_full_name
"
:
"
sarah
"
,
"
user_phone_number
"
:
"
+628123456789
"
,
"
program_name
"
:
"
Program Mengaji Bersama
"
,
"
donation_type
"
:
"
GDS
"
,
"
donation_status
"
:
"
002
"
,
"
amount
"
:
null
,
"
readable_donation_status
"
:
"
Selesai
"
,
"
proof_of_bank_transfer
"
:
null
,
"
user_bank_name
"
:
null
,
"
user_bank_account_name
"
:
null
,
"
bank_account_transfer_destination
"
:
null
,
"
transfer_destination_bank_name
"
:
null
,
"
transfer_destination_bank_account_name
"
:
null
,
"
transfer_destination_bank_account_number
"
:
null
,
"
goods_quantity
"
:
"1"
,
"
goods_description
"
:
"
kaos
"
,
"
delivery_method
"
:
"
PCK
"
,
"
delivery_address
"
:
"
rumah
"
,
"
created_at
"
:
"
2020-11-27T09:11:13.019671+07:00
"
,
"
updated_at
"
:
"
2020-12-05T20:29:11.013324+07:00
"
'
id
'
:
'
5b0a405c-a5a2-415e-9788-2b52c50792b1
'
,
'
donation_number
'
:
'
8DVQQ6
'
,
'
program
'
:
'
b02580b3-d1ab-4bf8-b4c3-87a340ed3319
'
,
'
program_code
'
:
'
5GZW45
'
,
'
user
'
:
'
f26c3bcd-f9d3-469e-b466-57610d9acdcb
'
,
'
user_username
'
:
'
sarah
'
,
'
user_full_name
'
:
'
sarah
'
,
'
user_phone_number
'
:
'
+628123456789
'
,
'
program_name
'
:
'
Program Mengaji Bersama
'
,
'
donation_type
'
:
'
GDS
'
,
'
donation_status
'
:
'
002
'
,
'
amount
'
:
null
,
'
readable_donation_status
'
:
'
Selesai
'
,
'
proof_of_bank_transfer
'
:
null
,
'
user_bank_name
'
:
null
,
'
user_bank_account_name
'
:
null
,
'
bank_account_transfer_destination
'
:
null
,
'
transfer_destination_bank_name
'
:
null
,
'
transfer_destination_bank_account_name
'
:
null
,
'
transfer_destination_bank_account_number
'
:
null
,
'
goods_quantity
'
:
'1'
,
'
goods_description
'
:
'
kaos
'
,
'
delivery_method
'
:
'
PCK
'
,
'
delivery_address
'
:
'
rumah
'
,
'
created_at
'
:
'
2020-11-27T09:11:13.019671+07:00
'
,
'
updated_at
'
:
'
2020-12-05T20:29:11.013324+07:00
'
}
]
}));
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment