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
b1801bee
Commit
b1801bee
authored
Dec 29, 2020
by
Tsamara Esperanti Erwin
Browse files
[REFACTOR] Remove bugs and issues
parent
8845811c
Pipeline
#62342
passed with stages
in 7 minutes and 19 seconds
Changes
24
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lib/Component/custom_input_form.dart
View file @
b1801bee
...
...
@@ -48,8 +48,9 @@ class _CustomTextInputFormState extends State<CustomTextInputForm> {
return
TextFormField
(
initialValue:
widget
.
initialValue
,
decoration:
customInputDecorationForm
(
context
,
widget
.
label
,
widget
.
prefixText
,
widget
.
prefixIcon
),
obscureText:
widget
.
isPassword
==
true
?
_obscureText
:
false
,
customInputDecorationForm
(
context
,
widget
.
label
,
widget
.
prefixText
,
widget
.
prefixIcon
),
obscureText:
widget
.
isPassword
&&
_obscureText
,
onFieldSubmitted:
widget
.
onSubmit
,
onSaved:
widget
.
onSave
,
maxLength:
widget
.
maxLength
,
...
...
lib/Pages/Bank/rekening.dart
View file @
b1801bee
...
...
@@ -103,7 +103,6 @@ class _ListItemBank extends StatelessWidget {
margin:
const
EdgeInsets
.
symmetric
(
vertical:
5
),
child:
Material
(
type:
MaterialType
.
card
,
shadowColor:
Colors
.
black
,
shape:
const
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
4.0
))),
elevation:
1
,
...
...
lib/Pages/Cart/cart.dart
View file @
b1801bee
...
...
@@ -36,7 +36,6 @@ class CartView extends StatelessWidget {
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
Expanded
(
flex:
3
,
...
...
@@ -184,7 +183,6 @@ class _CartDescription extends StatelessWidget {
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
Text
(
'
${cartItem.product.name}
'
,
...
...
@@ -218,7 +216,7 @@ class _CartDescription extends StatelessWidget {
color:
Theme
.
of
(
context
)
.
primaryColor
,
shape:
BoxShape
.
circle
,
),
margin:
EdgeInsets
.
symmetric
(
vertical:
3.0
),
margin:
const
EdgeInsets
.
symmetric
(
vertical:
3.0
),
child:
const
Icon
(
Icons
.
delete_forever
,
color:
Colors
.
white
,),
),
...
...
@@ -245,7 +243,9 @@ class _CartDescription extends StatelessWidget {
key:
ValueKey
<
int
>(
cartItem
.
quantity
),
text:
TextSpan
(
text:
'Jumlah: '
,
style:
const
TextStyle
(
color:
Colors
.
black
,
fontSize:
15
),
style:
const
TextStyle
(
color:
Colors
.
black
,
fontSize:
15
),
children:
<
TextSpan
>[
TextSpan
(
text:
'
${cartItem.quantity}
'
,
...
...
@@ -261,7 +261,8 @@ class _CartDescription extends StatelessWidget {
child:
PriceTextFormatter
(
key:
ValueKey
<
int
>(
cartItem
.
quantity
),
price:
'
${double.parse(cartItem.product.price) * cartItem.quantity}
'
,
'
${double.parse(cartItem.product.price)
* cartItem.quantity}
'
,
style:
TextStyle
(
fontSize:
16
,
fontWeight:
FontWeight
.
w800
,
...
...
@@ -397,7 +398,7 @@ class _ModalCartItem extends StatelessWidget {
decoration:
ShapeDecoration
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
shape:
CircleBorder
(),
shape:
const
CircleBorder
(),
),
child:
IconButton
(
icon:
const
Icon
(
Icons
.
remove
),
...
...
@@ -421,7 +422,7 @@ class _ModalCartItem extends StatelessWidget {
decoration:
ShapeDecoration
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
shape:
CircleBorder
(),
shape:
const
CircleBorder
(),
),
child:
IconButton
(
icon:
const
Icon
(
Icons
.
add
),
...
...
lib/Pages/Donation/bloc_goods_donation/goods_donation_bloc.dart
View file @
b1801bee
...
...
@@ -10,7 +10,9 @@ import 'goods_donation_state.dart';
class
GoodsDonationBloc
extends
Bloc
<
GoodsDonationEvent
,
GoodsDonationState
>
{
final
DonationRepository
_donationRepository
;
GoodsDonationBloc
(
this
.
_donationRepository
,
this
.
_changeBottomNavigationBarBloc
);
GoodsDonationBloc
(
this
.
_donationRepository
,
this
.
_changeBottomNavigationBarBloc
);
final
ChangeBottomNavigationBarBloc
_changeBottomNavigationBarBloc
;
@override
...
...
lib/Pages/Donation/bloc_money_donation/money_donation_bloc.dart
View file @
b1801bee
...
...
@@ -9,7 +9,9 @@ import 'money_donation_state.dart';
class
MoneyDonationBloc
extends
Bloc
<
DonationEvent
,
MoneyDonationState
>
{
final
DonationRepository
_donationRepository
;
MoneyDonationBloc
(
this
.
_donationRepository
,
this
.
_changeBottomNavigationBarBloc
);
MoneyDonationBloc
(
this
.
_donationRepository
,
this
.
_changeBottomNavigationBarBloc
);
final
ChangeBottomNavigationBarBloc
_changeBottomNavigationBarBloc
;
@override
...
...
lib/Pages/Donation/donation_dialog.dart
View file @
b1801bee
...
...
@@ -112,8 +112,10 @@ class __ChooseDonationState extends State<_ChooseDonation> {
child:
Center
(
child:
Text
(
'OK'
,
style:
Theme
.
of
(
context
)
.
textTheme
.
bodyText1
.
copyWith
(
fontSize:
18
,
color:
const
Color
.
fromRGBO
(
60
,
141
,
188
,
1
)),
style:
Theme
.
of
(
context
).
textTheme
.
bodyText1
.
copyWith
(
fontSize:
18
,
color:
const
Color
.
fromRGBO
(
60
,
141
,
188
,
1
)),
),
)),
],
...
...
lib/Pages/Donation/goods_donation_page.dart
View file @
b1801bee
...
...
@@ -119,7 +119,6 @@ class _DonasiBarangState extends State<DonasiBarang> {
child:
Form
(
key:
_formKey
,
child:
Column
(
mainAxisSize:
MainAxisSize
.
max
,
children:
[
..
.
_getGoodsForm
(),
Row
(
...
...
@@ -156,11 +155,13 @@ class _DonasiBarangState extends State<DonasiBarang> {
),
const
SizedBox
(
width:
70
),
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
/
2
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
/
2
,
height:
80
,
color:
Colors
.
white
,
child:
Padding
(
padding:
const
EdgeInsets
.
only
(
top:
8.0
),
padding:
const
EdgeInsets
.
only
(
top:
8.0
),
child:
TextFormField
(
controller:
addressController
,
keyboardType:
...
...
@@ -331,14 +332,18 @@ class GoodsForm extends StatefulWidget {
}
class
_GoodsFormState
extends
State
<
GoodsForm
>
{
final
TextEditingController
_goodsDescriptionController
=
TextEditingController
();
final
TextEditingController
_goodsQuantityController
=
TextEditingController
();
final
TextEditingController
_goodsDescriptionController
=
TextEditingController
();
final
TextEditingController
_goodsQuantityController
=
TextEditingController
();
@override
Widget
build
(
BuildContext
context
)
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
timeStamp
)
{
_goodsDescriptionController
.
text
=
_DonasiBarangState
.
goodsDescList
[
widget
.
index
]
??
''
;
_goodsQuantityController
.
text
=
_DonasiBarangState
.
goodsQtyList
[
widget
.
index
]
??
''
;
_goodsDescriptionController
.
text
=
_DonasiBarangState
.
goodsDescList
[
widget
.
index
]
??
''
;
_goodsQuantityController
.
text
=
_DonasiBarangState
.
goodsQtyList
[
widget
.
index
]
??
''
;
});
return
Column
(
...
...
@@ -369,7 +374,8 @@ class _GoodsFormState extends State<GoodsForm> {
height:
50
,
child:
TextFormField
(
key:
const
Key
(
'goods-desc'
),
onChanged:
(
v
)
=
>
_DonasiBarangState
.
goodsDescList
[
widget
.
index
]
=
v
,
onChanged:
(
v
)
=
>
_DonasiBarangState
.
goodsDescList
[
widget
.
index
]
=
v
,
controller:
_goodsDescriptionController
,
validator:
(
value
)
{
return
value
.
isEmpty
...
...
@@ -410,7 +416,8 @@ class _GoodsFormState extends State<GoodsForm> {
color:
Colors
.
white
,
child:
TextFormField
(
key:
const
Key
(
'goods-qty'
),
onChanged:
(
v
)
=
>
_DonasiBarangState
.
goodsQtyList
[
widget
.
index
]
=
v
,
onChanged:
(
v
)
=
>
_DonasiBarangState
.
goodsQtyList
[
widget
.
index
]
=
v
,
controller:
_goodsQuantityController
,
validator:
(
value
)
{
return
value
.
isEmpty
...
...
lib/Pages/Donation/repositories/donation_repository.dart
View file @
b1801bee
...
...
@@ -24,9 +24,15 @@ class DonationRepository {
await
_dio
.
post
(
url
,
data:
formData
);
}
Future
<
void
>
createGoodsDonation
(
String
program
,
String
quantity
,
String
description
,
String
address
,
String
methodOfDelivery
)
async
{
Future
<
void
>
createGoodsDonation
(
String
program
,
String
quantity
,
String
description
,
String
address
,
String
methodOfDelivery
)
async
{
String
deliveryAddress
;
methodOfDelivery
==
'DLV'
?
deliveryAddress
=
null
:
deliveryAddress
=
address
;
methodOfDelivery
==
'DLV'
?
deliveryAddress
=
null
:
deliveryAddress
=
address
;
final
formData
=
FormData
.
fromMap
({
'program'
:
program
,
'donation_type'
:
'GDS'
,
...
...
lib/Pages/DonationHistory/donation_history.dart
View file @
b1801bee
...
...
@@ -178,7 +178,10 @@ class _DonationDetaiDialog extends StatelessWidget {
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
),)
style:
const
TextStyle
(
fontSize:
16.0
,
height:
1.3
,
fontWeight:
FontWeight
.
bold
),)
],),
),
const
SizedBox
(
height:
10.0
,),
...
...
@@ -210,11 +213,9 @@ class _DonationListItem extends StatelessWidget {
Expanded
(
flex:
15
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
children:
<
Widget
>[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
...
...
@@ -283,7 +284,6 @@ class _DonationListItem extends StatelessWidget {
flex:
11
,
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
donation
.
donationStatus
.
readable
,
...
...
@@ -295,7 +295,8 @@ class _DonationListItem extends StatelessWidget {
fontWeight:
FontWeight
.
w600
,
fontSize:
15
),
),
if
(
donation
.
donationType
==
'CSH'
&&
(
donation
.
donationStatus
==
if
(
donation
.
donationType
==
'CSH'
&&
(
donation
.
donationStatus
==
StatusDonation
.
waitAdminConfirmation
||
donation
.
donationStatus
==
StatusDonation
.
waitProofAgain
))
FlatButton
(
...
...
lib/Pages/DonationReupload/donation_re_upload.dart
View file @
b1801bee
...
...
@@ -83,7 +83,6 @@ class _DonationReUploadState extends State<DonationReUpload> {
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
mainAxisAlignment:
MainAxisAlignment
.
start
,
children:
<
Widget
>[
Container
(
height:
40
,
...
...
lib/Pages/Home/home_page.dart
View file @
b1801bee
...
...
@@ -15,7 +15,6 @@ class Home extends StatelessWidget {
padding:
const
EdgeInsets
.
symmetric
(
horizontal:
10
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
const
<
Widget
>[
HomeProfilePlaceholder
(),
HomePlaceHolder
(
...
...
@@ -71,11 +70,10 @@ class HomeProfile extends StatelessWidget {
padding:
const
EdgeInsets
.
only
(
bottom:
12
),
width:
double
.
maxFinite
,
decoration:
BoxDecoration
(
border:
Border
.
all
(
color:
Colors
.
black
,
width:
1.2
),
border:
Border
.
all
(
width:
1.2
),
borderRadius:
BorderRadius
.
circular
(
10
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
center
,
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
<
Widget
>[
const
Text
(
'SELAMAT DATANG'
,
...
...
@@ -128,7 +126,7 @@ class HomePlaceHolder extends StatelessWidget {
image:
DecorationImage
(
image:
AssetImage
(
image
),
fit:
BoxFit
.
cover
),
color:
Colors
.
white
,
border:
Border
.
all
(
color:
Colors
.
black
,
width:
1.2
),
border:
Border
.
all
(
width:
1.2
),
borderRadius:
BorderRadius
.
circular
(
10
),
),
),
...
...
lib/Pages/Login/otp_page.dart
View file @
b1801bee
...
...
@@ -57,17 +57,16 @@ class OTPPage extends StatelessWidget {
child:
Center
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
<
Widget
>[
const
Text
(
'Mohon masukkan OTP yang dikirim ke nomor anda'
,
softWrap:
true
),
const
Divider
(
height:
20
,
thickness:
null
,
),
Theme
(
data:
Theme
.
of
(
context
)
.
copyWith
(
inputDecorationTheme:
const
InputDecorationTheme
()),
.
copyWith
(
inputDecorationTheme:
const
InputDecorationTheme
()),
child:
PinPut
(
onSubmit:
(
String
pin
)
{
_otpSubmitted
(
pin
,
context
);
...
...
lib/Pages/Product/bloc_search_product/search_product_state.dart
View file @
b1801bee
...
...
@@ -12,7 +12,8 @@ abstract class SearchProductState extends Equatable {
}
class
InitialSearchProductState
extends
SearchProductState
{
const
InitialSearchProductState
({
hasReachedMax
})
:
super
(
0
,
''
,
hasReachedMax:
true
);
const
InitialSearchProductState
({
hasReachedMax
})
:
super
(
0
,
''
,
hasReachedMax:
true
);
@override
List
<
Object
>
get
props
=
>
[
page
,
searchQuery
];
...
...
lib/Pages/Product/component/list_product_grid.dart
View file @
b1801bee
...
...
@@ -118,8 +118,8 @@ class ProductGrid extends StatelessWidget {
borderRadius:
BorderRadius
.
circular
(
8
),
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
offset:
const
Offset
(
2
,
0
),
const
BoxShadow
(
offset:
Offset
(
2
,
0
),
color:
Colors
.
black38
,
blurRadius:
10
,
spreadRadius:
0.5
),
...
...
@@ -170,7 +170,7 @@ class ProductGrid extends StatelessWidget {
BlocProvider
.
of
<
CartBloc
>(
context
)
.
add
(
AddCartItem
(
1
,
_product
.
id
));
},
icon:
Icon
(
icon:
const
Icon
(
Icons
.
add_shopping_cart
,
),
alignment:
Alignment
.
bottomCenter
,
...
...
lib/Pages/Product/component/product_item_list.dart
View file @
b1801bee
...
...
@@ -113,7 +113,7 @@ class _ProductDescription extends StatelessWidget {
BlocProvider
.
of
<
CartBloc
>(
context
)
.
add
(
AddCartItem
(
1
,
product
.
id
));
},
icon:
Icon
(
Icons
.
add_shopping_cart
),
icon:
const
Icon
(
Icons
.
add_shopping_cart
),
label:
Text
(
product
.
stock
==
0
?
'Habis'
:
'Tambah'
),
color:
Theme
.
of
(
context
)
.
primaryColor
,
textColor:
const
Color
(
0xff003636
),
...
...
lib/Pages/Product/component/sliver_app_bar_product.dart
View file @
b1801bee
...
...
@@ -75,7 +75,7 @@ class _SliverAppBarProductState extends State<SliverAppBarProduct> {
shape:
const
CircleBorder
(),
),
child:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back
),
icon:
const
Icon
(
Icons
.
arrow_back
),
onPressed:
()
{
Navigator
.
of
(
context
)
.
pop
();
},
...
...
@@ -83,7 +83,7 @@ class _SliverAppBarProductState extends State<SliverAppBarProduct> {
),
),
secondChild:
IconButton
(
icon:
Icon
(
Icons
.
arrow_back
),
icon:
const
Icon
(
Icons
.
arrow_back
),
onPressed:
()
{
Navigator
.
of
(
context
)
.
pop
();
},
...
...
@@ -92,9 +92,7 @@ class _SliverAppBarProductState extends State<SliverAppBarProduct> {
isFirst
?
CrossFadeState
.
showFirst
:
CrossFadeState
.
showSecond
,
),
),
floating:
false
,
pinned:
true
,
snap:
false
,
backgroundColor:
Colors
.
white
,
title:
AnimatedCrossFade
(
duration:
duration
,
...
...
@@ -109,7 +107,7 @@ class _SliverAppBarProductState extends State<SliverAppBarProduct> {
'
${widget.label}
'
,
maxLines:
2
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
),
style:
const
TextStyle
(
color:
Colors
.
black
),
),
),
secondChild:
Container
(
...
...
@@ -119,7 +117,7 @@ class _SliverAppBarProductState extends State<SliverAppBarProduct> {
'
${widget.label}
'
,
maxLines:
2
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
),
style:
const
TextStyle
(
color:
Colors
.
black
),
),
),
crossFadeState:
...
...
lib/Pages/Product/detail_product.dart
View file @
b1801bee
...
...
@@ -124,10 +124,12 @@ class _BodyDetailProduct extends StatelessWidget {
ShapeDecoration
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
shape:
CircleBorder
(),
shape:
const
CircleBorder
(),
),
child:
IconButton
(
icon:
const
Icon
(
Icons
.
remove
),
icon:
const
Icon
(
Icons
.
remove
),
onPressed:
()
{
context
.
read
<
CounterItem
>()
...
...
@@ -148,7 +150,7 @@ class _BodyDetailProduct extends StatelessWidget {
decoration:
ShapeDecoration
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
shape:
CircleBorder
(),
shape:
const
CircleBorder
(),
),
child:
IconButton
(
icon:
const
Icon
(
Icons
.
add
),
...
...
lib/Pages/ProductPayment/product_payment.dart
View file @
b1801bee
...
...
@@ -519,7 +519,8 @@ class _ItemOrdered extends StatelessWidget {
),
trailing:
PriceTextFormatter
(
price:
'
${transactionItem.quantity * double.parse(transactionItem.productPrice)}
'
,
'
${transactionItem.quantity
* double.parse(transactionItem.productPrice)}
'
,
style:
const
TextStyle
(
fontSize:
16
,
fontWeight:
FontWeight
.
w600
,
...
...
lib/Pages/Program/bloc_program/program_bloc.dart
View file @
b1801bee
...
...
@@ -60,11 +60,13 @@ class ProgramBloc extends Bloc<ProgramEvent, ProgramState> {
}
catch
(
e
)
{
yield
ListProgramsError
(
error:
e
.
toString
());
}
}
else
if
((
event
is
FetchProgramByStatus
)
&&
!
_hasReachedMaxSorted
(
currentState
))
{
}
else
if
((
event
is
FetchProgramByStatus
)
&&
!
_hasReachedMaxSorted
(
currentState
))
{
try
{
final
programs
=
await
programRepository
.
fetchProgram
(
page:
currentState
.
page
+
1
);
if
(
currentState
is
ListProgramsLoaded
||
currentState
is
InitialListProgramState
)
{
if
(
currentState
is
ListProgramsLoaded
||
currentState
is
InitialListProgramState
)
{
final
sort
=
sortPrograms
(
programs
.
results
);
yield
ListProgramsSortedLoaded
(
programs:
sort
,
...
...
lib/Pages/Program/bloc_progress_program/progress_program_bloc.dart
View file @
b1801bee
...
...
@@ -10,20 +10,27 @@ import 'package:home_industry/Pages/Program/repositories/program_repository.dart
part
'progress_program_event.dart'
;
part
'progress_program_state.dart'
;
class
ProgressProgramBloc
extends
Bloc
<
ProgressProgramEvent
,
ProgressProgramState
>
{
class
ProgressProgramBloc
extends
Bloc
<
ProgressProgramEvent
,
ProgressProgramState
>
{
final
Program
program
;
final
ProgramRepository
progressProgramRepository
;
ProgressProgramBloc
({
@required
this
.
progressProgramRepository
,
@required
this
.
program
})
ProgressProgramBloc
({
@required
this
.
progressProgramRepository
,
@required
this
.
program
})
:
assert
(
progressProgramRepository
!=
null
);
@override
ProgressProgramState
get
initialState
=
>
const
ProgressProgramInitial
();
@override
Stream
<
ProgressProgramState
>
mapEventToState
(
ProgressProgramEvent
event
)
async
*
{
Stream
<
ProgressProgramState
>
mapEventToState
(
ProgressProgramEvent
event
)
async
*
{
if
(
event
is
FetchProgressProgram
)
{
try
{
final
progressProgram
=
await
progressProgramRepository
.
fetchProgressProgram
(
program
.
id
);
final
progressProgram
=
await
progressProgramRepository
.
fetchProgressProgram
(
program
.
id
);
yield
ProgressProgramLoaded
(
progressProgram
);
}
on
DioError
catch
(
_
)
{
yield
ProgressProgramError
(
error:
_
.
response
.
toString
());
...
...
Prev
1
2
Next
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