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
6ee30340
Commit
6ee30340
authored
Dec 10, 2020
by
Tsamara Esperanti Erwin
🦄
Browse files
Coldfix pbi7
parent
73d09c86
Changes
13
Hide whitespace changes
Inline
Side-by-side
lib/Pages/Cart/cart.dart
View file @
6ee30340
...
...
@@ -351,9 +351,11 @@ class _ModalCartItem extends StatelessWidget {
flex:
5
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
space
Between
,
MainAxisAlignment
.
space
Around
,
children:
<
Widget
>[
Ink
(
width:
30
,
height:
30
,
decoration:
const
ShapeDecoration
(
color:
Colors
.
red
,
shape:
CircleBorder
(),
...
...
@@ -366,7 +368,7 @@ class _ModalCartItem extends StatelessWidget {
.
decrement
();
},
color:
Colors
.
white
,
iconSize:
30
)),
iconSize:
15
)),
Consumer
<
CounterItem
>(
builder:
(
_
,
counter
,
__
)
=
>
Text
(
'
${counter.total}
'
,
...
...
@@ -375,6 +377,8 @@ class _ModalCartItem extends StatelessWidget {
),
),
Ink
(
width:
30
,
height:
30
,
decoration:
const
ShapeDecoration
(
color:
Colors
.
green
,
shape:
CircleBorder
(),
...
...
@@ -387,7 +391,7 @@ class _ModalCartItem extends StatelessWidget {
.
increment
();
},
color:
Colors
.
white
,
iconSize:
30
,
iconSize:
15
,
)),
],
),
...
...
lib/Pages/Donation/goods_donation_page.dart
View file @
6ee30340
...
...
@@ -151,21 +151,24 @@ class _DonasiBarangState extends State<DonasiBarang> {
),
const
SizedBox
(
width:
70
),
Container
(
width:
187
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
/
1.8
,
height:
80
,
color:
Colors
.
white
,
child:
TextFormField
(
controller:
addressController
,
keyboardType:
TextInputType
.
multiline
,
validator:
(
value
)
{
if
(
value
.
isEmpty
)
{
return
'Mohon isi alamat'
;
}
return
null
;
},
maxLines:
5
,
decoration:
_inputDecoration
()))
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
8.0
),
child:
TextFormField
(
controller:
addressController
,
keyboardType:
TextInputType
.
multiline
,
validator:
(
value
)
{
if
(
value
.
isEmpty
)
{
return
'Mohon isi alamat'
;
}
return
null
;
},
maxLines:
5
,
decoration:
_inputDecoration
()),
))
],
);
});
...
...
@@ -359,7 +362,7 @@ class _GoodsFormState extends State<GoodsForm> {
),
const
SizedBox
(
width:
20
),
Container
(
width:
187
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
/
1.8
,
height:
50
,
child:
TextFormField
(
key:
const
Key
(
'goods-desc'
),
...
...
@@ -399,7 +402,7 @@ class _GoodsFormState extends State<GoodsForm> {
),
const
SizedBox
(
width:
70
),
Container
(
width:
187
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
/
1.8
,
height:
50
,
color:
Colors
.
white
,
child:
TextFormField
(
...
...
lib/Pages/Donation/money_donation_page.dart
View file @
6ee30340
...
...
@@ -336,7 +336,7 @@ class _FormViewState extends State<_FormView> {
onPressed:
_buttonSendClicked
,
label:
context
.
watch
<
Donation
>()
!=
null
?
'Unggah ulang'
:
'Donasi'
)),
:
'Donasi
Sekarang
'
)),
const
Divider
(
height:
10
,
),
...
...
lib/Pages/Product/component/sliver_app_bar_product.dart
View file @
6ee30340
...
...
@@ -68,6 +68,8 @@ class _SliverAppBarProductState extends State<SliverAppBarProduct> {
firstChild:
Material
(
color:
Colors
.
transparent
,
child:
Ink
(
height:
40
,
width:
40
,
decoration:
ShapeDecoration
(
color:
Colors
.
grey
.
withOpacity
(
0.7
),
shape:
const
CircleBorder
(),
...
...
@@ -184,6 +186,8 @@ class _ActionFlexibleExpanded extends StatelessWidget {
return
Material
(
color:
Colors
.
transparent
,
child:
Ink
(
height:
40
,
width:
40
,
decoration:
ShapeDecoration
(
color:
Colors
.
grey
.
withOpacity
(
0.7
),
shape:
const
CircleBorder
(),
...
...
lib/Pages/Product/detail_product.dart
View file @
6ee30340
...
...
@@ -118,9 +118,11 @@ class _BodyDetailProduct extends StatelessWidget {
flex:
5
,
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
space
Between
,
MainAxisAlignment
.
space
Around
,
children:
<
Widget
>[
Ink
(
width:
30
,
height:
30
,
decoration:
const
ShapeDecoration
(
color:
Colors
.
red
,
...
...
@@ -134,7 +136,7 @@ class _BodyDetailProduct extends StatelessWidget {
.
decrement
();
},
color:
Colors
.
white
,
iconSize:
30
)),
iconSize:
15
)),
Consumer
<
CounterItem
>(
builder:
(
_
,
counter
,
__
)
=
>
Text
(
'
${counter.total}
'
,
...
...
@@ -143,6 +145,8 @@ class _BodyDetailProduct extends StatelessWidget {
),
),
Ink
(
width:
30
,
height:
30
,
decoration:
const
ShapeDecoration
(
color:
Colors
.
green
,
shape:
CircleBorder
(),
...
...
@@ -155,7 +159,7 @@ class _BodyDetailProduct extends StatelessWidget {
.
increment
();
},
color:
Colors
.
white
,
iconSize:
30
,
iconSize:
15
,
)),
],
),
...
...
lib/Pages/Profile/edit_profile.dart
View file @
6ee30340
...
...
@@ -12,6 +12,7 @@ import 'package:home_industry/Pages/Profile/bloc/profile_event.dart';
import
'package:home_industry/Pages/Profile/bloc/profile_state.dart'
;
import
'package:home_industry/Pages/Profile/model/profile.dart'
;
import
'package:image_picker/image_picker.dart'
;
import
'package:outline_material_icons/outline_material_icons.dart'
;
class
EditProfile
extends
StatelessWidget
{
const
EditProfile
({
Key
key
})
:
super
(
key:
key
);
...
...
@@ -344,7 +345,7 @@ class _EditFormState extends State<EditForm> {
flex:
20
,
child:
CustomTextInputForm
(
isNumberOnly:
true
,
prefixIcon:
Icons
.
my_location
,
prefixIcon:
OM
Icons
.
nearMe
,
key:
const
Key
(
'rt'
),
label:
'RT'
,
onSave:
_updateRt
,
...
...
@@ -359,7 +360,7 @@ class _EditFormState extends State<EditForm> {
flex:
20
,
child:
CustomTextInputForm
(
isNumberOnly:
true
,
prefixIcon:
Icons
.
my_location
,
prefixIcon:
OM
Icons
.
nearMe
,
key:
const
Key
(
'rw'
),
label:
'RW'
,
onSave:
_updateRw
,
...
...
@@ -378,7 +379,7 @@ class _EditFormState extends State<EditForm> {
flex:
20
,
child:
CustomTextInputForm
(
key:
const
Key
(
'kelurahan'
),
prefixIcon:
Icons
.
location_searching
,
prefixIcon:
Icons
.
near_me
,
label:
'Kelurahan'
,
onSave:
_updateKelurahan
,
maxLength:
100
,
...
...
@@ -393,7 +394,7 @@ class _EditFormState extends State<EditForm> {
child:
CustomTextInputForm
(
key:
const
Key
(
'kecamatan'
),
label:
'Kecamatan'
,
prefixIcon:
Icons
.
location_searching
,
prefixIcon:
Icons
.
near_me
,
onSave:
_updateKecamatan
,
maxLength:
100
,
initialValue:
widget
.
profile
.
subDistrict
,
...
...
lib/Pages/Program/detail_program.dart
View file @
6ee30340
...
...
@@ -73,11 +73,9 @@ class DetailProgram extends StatelessWidget {
'
${formatDate(program.startDateTime)}
'
),
if
(
program
.
endDateTime
!=
null
)
_DeskripsiRow
(
icon:
Icons
.
cancel
,
icon:
Icons
.
schedule
,
label:
'
${formatTime(program.startDateTime)}
'
' - '
'
${formatTime(program.endDateTime)}
'
,
'
${formatTime(program.startDateTime)}
'
,
),
if
(
program
.
location
!=
null
&&
program
.
location
!=
''
)
...
...
lib/Pages/Program/program_page.dart
View file @
6ee30340
...
...
@@ -64,7 +64,7 @@ class _ProgramsState extends State<Programs> {
RepositoryProvider
.
of
<
ProgramRepository
>(
context
))
.
.
add
(
const
FetchProgram
()),
child:
Column
(
children:
<
Widget
>[
programList
programList
,
]),
),
),
...
...
@@ -157,25 +157,25 @@ class __ListProgramState extends State<_ListProgram> {
),
);
}
else
{
return
SizedBox
(
height:
MediaQuery
.
of
(
context
)
.
size
.
height
-
50
,
child:
ListView
.
builder
(
itemCount:
state
.
hasReachedMax
?
state
.
programs
.
length
:
state
.
programs
.
length
+
1
,
controller:
_scrollController
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
physics:
const
BouncingScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
index
>
=
state
.
programs
.
length
?
const
Cent
er
(
child:
CustomCircularIndicator
(),
)
:
ProgramCard
(
program:
state
.
programs
[
index
]
,
);
})
,
return
Column
(
children:
[
ListView
.
builder
(
itemCount:
state
.
hasReachedMax
?
state
.
programs
.
length
:
state
.
programs
.
length
+
1
,
controller:
_scrollController
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
physics:
const
BouncingScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
index
>
=
state
.
programs
.
length
?
Contain
er
(
)
:
ProgramCard
(
program:
state
.
programs
[
index
],
);
})
,
Container
(
height:
10
)
]
,
);
}
}
else
if
(
state
is
ListProgramsSortedLoaded
)
{
...
...
@@ -187,25 +187,25 @@ class __ListProgramState extends State<_ListProgram> {
),
);
}
else
{
return
SizedBox
(
height:
MediaQuery
.
of
(
context
)
.
size
.
height
-
50
,
child:
ListView
.
builder
(
itemCount:
state
.
hasReachedMax
?
state
.
programs
.
length
:
state
.
programs
.
length
+
1
,
controller:
_scrollController
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
physics:
const
BouncingScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
index
>
=
state
.
programs
.
length
?
const
Cent
er
(
child:
CustomCircularIndicator
(),
)
:
ProgramCard
(
program:
state
.
programs
[
index
]
,
);
})
,
return
Column
(
children:
[
ListView
.
builder
(
itemCount:
state
.
hasReachedMax
?
state
.
programs
.
length
:
state
.
programs
.
length
+
1
,
controller:
_scrollController
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
physics:
const
BouncingScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
index
>
=
state
.
programs
.
length
?
Contain
er
(
)
:
ProgramCard
(
program:
state
.
programs
[
index
],
);
})
,
Container
(
height:
10
)
]
,
);
}
}
...
...
@@ -269,25 +269,25 @@ class __ListProgramSortStatusState extends State<_ListProgramSortStatus> {
),
);
}
else
{
return
SizedBox
(
height:
MediaQuery
.
of
(
context
)
.
size
.
height
-
50
,
child:
ListView
.
builder
(
itemCount:
state
.
hasReachedMax
?
state
.
programs
.
length
:
state
.
programs
.
length
+
1
,
controller:
_scrollController
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
physics:
const
BouncingScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
index
>
=
state
.
programs
.
length
?
const
Cent
er
(
child:
CustomCircularIndicator
(),
)
:
ProgramCard
(
program:
state
.
programs
[
index
]
,
);
})
,
return
Column
(
children:
[
ListView
.
builder
(
itemCount:
state
.
hasReachedMax
?
state
.
programs
.
length
:
state
.
programs
.
length
+
1
,
controller:
_scrollController
,
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
physics:
const
BouncingScrollPhysics
(),
shrinkWrap:
true
,
itemBuilder:
(
BuildContext
context
,
int
index
)
{
return
index
>
=
state
.
programs
.
length
?
Contain
er
(
)
:
ProgramCard
(
program:
state
.
programs
[
index
],
);
})
,
Container
(
height:
10
)
]
,
);
}
}
...
...
lib/Pages/Register/register.dart
View file @
6ee30340
...
...
@@ -7,6 +7,7 @@ import 'package:home_industry/Pages/Register/bloc/bloc.dart';
import
'package:home_industry/Pages/Register/model/register_model.dart'
;
import
'package:home_industry/Pages/Register/repositories/register_repository.dart'
;
import
'package:home_industry/State/Auth/repositories/depedencies_repositories.dart'
;
import
'package:outline_material_icons/outline_material_icons.dart'
;
class
Register
extends
StatelessWidget
{
const
Register
({
Key
key
})
:
super
(
key:
key
);
...
...
@@ -219,7 +220,7 @@ class _RegisterFormState extends State<RegisterForm> {
flex:
20
,
child:
CustomTextInputForm
(
isNumberOnly:
true
,
prefixIcon:
Icons
.
my_location
,
prefixIcon:
OM
Icons
.
nearMe
,
key:
const
Key
(
'rt'
),
label:
'RT'
,
onSave:
_updateRt
,
...
...
@@ -233,7 +234,7 @@ class _RegisterFormState extends State<RegisterForm> {
flex:
20
,
child:
CustomTextInputForm
(
isNumberOnly:
true
,
prefixIcon:
Icons
.
my_location
,
prefixIcon:
OM
Icons
.
nearMe
,
key:
const
Key
(
'rw'
),
label:
'RW'
,
onSave:
_updateRw
,
...
...
@@ -251,7 +252,7 @@ class _RegisterFormState extends State<RegisterForm> {
flex:
20
,
child:
CustomTextInputForm
(
key:
const
Key
(
'kelurahan'
),
prefixIcon:
Icons
.
location_searching
,
prefixIcon:
Icons
.
near_me
,
label:
'Kelurahan'
,
onSave:
_updateKelurahan
,
maxLength:
100
,
...
...
@@ -265,7 +266,7 @@ class _RegisterFormState extends State<RegisterForm> {
child:
CustomTextInputForm
(
key:
const
Key
(
'kecamatan'
),
label:
'Kecamatan'
,
prefixIcon:
Icons
.
location_searching
,
prefixIcon:
Icons
.
near_me
,
onSave:
_updateKecamatan
,
maxLength:
100
,
onSubmit:
_handleSubmitted
,
...
...
lib/Pages/Transactions/my_detail_order.dart
View file @
6ee30340
...
...
@@ -260,9 +260,7 @@ class __BodyState extends State<_Body> {
);
}
else
if
(
state
is
FetchOrderSuccess
&&
(
state
.
transaction
.
transactionStatus
==
StatusTransaction
.
waitProof
||
state
.
transaction
.
transactionStatus
==
StatusTransaction
.
canceled
||
state
.
transaction
.
transactionStatus
==
StatusTransaction
.
waitSellerConfirmation
))
{
StatusTransaction
.
waitSellerConfirmation
))
{
return
Provider
<
Transaction
>
.
value
(
value:
state
.
transaction
,
child:
RefreshIndicator
(
...
...
@@ -271,24 +269,69 @@ class __BodyState extends State<_Body> {
.
add
(
const
RefreshOrderDetail
());
return
_refreshCompleter
.
future
;
},
child:
ListView
(
physics:
const
AlwaysScrollableScrollPhysics
(
parent:
BouncingScrollPhysics
()),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
20
),
children:
const
<
Widget
>[
_Alamat
(),
Divider
(
height:
20
,
thickness:
2
,
),
_Summary
(),
Divider
(
height:
20
,
thickness:
2
,
),
_PaymentMethod
(),
],
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
50
),
child:
ListView
(
physics:
const
AlwaysScrollableScrollPhysics
(
parent:
BouncingScrollPhysics
()),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
20
),
children:
const
<
Widget
>[
_Alamat
(),
Padding
(
padding:
EdgeInsets
.
only
(
left:
10.0
,
top:
5.0
),
child:
Text
(
'Barang akan dikirim setelah transaksi terkonfirmasi'
,
style:
TextStyle
(
fontSize:
12
,
color:
Color
.
fromRGBO
(
60
,
141
,
188
,
1
)),),
),
Divider
(
height:
20
,
thickness:
2
,
),
_Summary
(),
Divider
(
height:
20
,
thickness:
2
,
),
_PaymentMethod
(),
],
),
),
),
);
}
else
if
(
state
is
FetchOrderSuccess
&&
(
state
.
transaction
.
transactionStatus
==
StatusTransaction
.
canceled
)
)
{
return
Provider
<
Transaction
>
.
value
(
value:
state
.
transaction
,
child:
RefreshIndicator
(
onRefresh:
()
{
BlocProvider
.
of
<
DetailOrderBloc
>(
context
)
.
add
(
const
RefreshOrderDetail
());
return
_refreshCompleter
.
future
;
},
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
50
),
child:
ListView
(
physics:
const
AlwaysScrollableScrollPhysics
(
parent:
BouncingScrollPhysics
()),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
20
),
children:
const
<
Widget
>[
_Alamat
(),
Divider
(
height:
20
,
thickness:
2
,
),
_Summary
(),
Divider
(
height:
20
,
thickness:
2
,
),
_PaymentMethod
(),
],
),
),
),
);
...
...
@@ -308,25 +351,28 @@ class __BodyState extends State<_Body> {
.
add
(
const
RefreshOrderDetail
());
return
_refreshCompleter
.
future
;
},
child:
ListView
(
physics:
const
AlwaysScrollableScrollPhysics
(
parent:
BouncingScrollPhysics
()),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
20
),
children:
const
<
Widget
>[
_Alamat
(),
_ShipmentInfo
(),
Divider
(
height:
20
,
thickness:
2
,
),
_Summary
(),
Divider
(
height:
20
,
thickness:
2
,
),
_PaymentMethod
(),
],
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
50
),
child:
ListView
(
physics:
const
AlwaysScrollableScrollPhysics
(
parent:
BouncingScrollPhysics
()),
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
15
,
vertical:
20
),
children:
const
<
Widget
>[
_Alamat
(),
_ShipmentInfo
(),
Divider
(
height:
20
,
thickness:
2
,
),
_Summary
(),
Divider
(
height:
20
,
thickness:
2
,
),
_PaymentMethod
(),
],
),
),
),
);
...
...
@@ -461,7 +507,7 @@ class _Summary extends StatelessWidget {
);
},
icon:
Icon
(
Icons
.
description
,
Icons
.
visibility
,
color:
Theme
.
of
(
context
)
.
primaryColor
,
),
label:
Text
(
...
...
test/detail_order_test.dart
View file @
6ee30340
...
...
@@ -208,7 +208,7 @@ void main() {
expect
(
find
.
text
(
'GTXWP3PJ'
),
findsOneWidget
);
expect
(
find
.
text
(
'Rp155.040'
),
findsOneWidget
);
expect
(
find
.
text
(
'Unggah bukti pembayaran'
),
findsOneWidget
);
await
tester
.
tap
(
find
.
byIcon
(
Icons
.
description
));
await
tester
.
tap
(
find
.
byIcon
(
Icons
.
visibility
));
await
tester
.
pumpAndSettle
();
expect
(
find
.
byWidgetPredicate
((
Widget
widget
)
=
>
...
...
test/money_donation_page_test.dart
View file @
6ee30340
...
...
@@ -128,7 +128,7 @@ void main() {
testWidgets
(
'Donation page loads'
,
(
WidgetTester
tester
)
async
{
await
tester
.
pumpWidget
(
widgetTested
);
expect
(
find
.
byType
(
Form
),
findsOneWidget
);
expect
(
find
.
text
(
'Donasi'
),
finds
N
Widget
s
(
2
)
);
expect
(
find
.
text
(
'Donasi'
),
finds
One
Widget
);
expect
(
find
.
text
(
'Terima kasih! Silahkan transfer ke:'
),
findsOneWidget
);
expect
(
find
.
byType
(
TextFormField
),
findsNWidgets
(
3
));
expect
(
find
.
text
(
'Belum memilih foto'
),
findsOneWidget
);
...
...
test/program_page_test.dart
View file @
6ee30340
...
...
@@ -151,9 +151,9 @@ void main() {
await
tester
.
pumpWidget
(
widgetTested
);
expect
(
find
.
byType
(
CustomCircularIndicator
),
findsOneWidget
);
await
tester
.
pump
(
Duration
(
seconds:
3
));
expect
(
find
.
byType
(
Card
),
findsNWidgets
(
3
));
expect
(
find
.
text
(
'Rumah Belajar'
),
findsNWidgets
(
3
));
expect
(
find
.
text
(
'DETAIL'
),
findsNWidgets
(
3
));
expect
(
find
.
byType
(
Card
),
findsNWidgets
(
11
));
expect
(
find
.
text
(
'Rumah Belajar'
),
findsNWidgets
(
11
));