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
PPL Sosial
bisago
bisago-fe
Commits
9282aef8
Commit
9282aef8
authored
Jun 06, 2021
by
jovi_013
Browse files
[CHORES] Fix Conflicts
parents
e7103832
f9a04a8f
Changes
6
Hide whitespace changes
Inline
Side-by-side
lib/config/custom_serializer.dart
View file @
9282aef8
...
...
@@ -3,6 +3,5 @@ import 'package:intl/intl.dart';
class
CustomSerializer
{
static
DateTime
stringToDateTime
(
String
date
)
{
return
DateFormat
(
'yyyy-MM-dd HH:mm'
)
.
parse
(
date
);
// return DateFormat('%Y-%m-%dT%H:%M').parse(date);
}
}
lib/config/strings.dart
View file @
9282aef8
...
...
@@ -99,11 +99,11 @@ const fasilitas = {
'TB'
:
'Tempat Parkir Biasa'
,
};
const
zonaWaktu
=
{
'WIB'
:
'WIB'
,
'WITA'
:
'WITA'
,
'WIT'
:
'WIT'
,
}
;
const
zonaWaktu
=
[
'WIB'
,
'WITA'
,
'WIT'
,
]
;
String
getTag
(
String
tag
)
{
return
tags
[
tag
];
...
...
lib/page/add_informasi/add_informasi.dart
View file @
9282aef8
...
...
@@ -422,7 +422,6 @@ class AddInformasiState extends State<AddInformasi> {
.
asUint8List
();
newKomentarData
[
'image'
]
=
MultipartFile
.
fromBytes
(
bytes
,
filename:
'kursiroda.jpg'
);
print
(
'Fasilitas null dalem addinfo adalah: '
+
_jenisFasilitas
);
break
;
case
'LF'
:
var
bytes
=
...
...
@@ -520,7 +519,6 @@ class AddInformasiState extends State<AddInformasi> {
.
asUint8List
();
newKomentarData
[
'image'
]
=
MultipartFile
.
fromBytes
(
bytes
,
filename:
'defaultDisable.png'
);
print
(
'Fasilitas null default addinfo adalah: '
+
_jenisFasilitas
);
break
;
}
}
else
{
...
...
lib/page/filter_fasilitas/add_kegiatan.dart
View file @
9282aef8
...
...
@@ -3,16 +3,16 @@ import 'dart:async';
import
'package:bisaGo/bloc/kegiatan_bloc.dart'
;
import
'package:bisaGo/component/bisago_appbar.dart'
;
//
import 'package:bisaGo/config/strings.dart';
import
'package:bisaGo/config/strings.dart'
;
import
'package:bisaGo/config/styles.dart'
;
import
'package:bisaGo/model/kegiatan.dart'
;
import
'package:bisaGo/utils/custom_button.dart'
;
// import 'package:bisaGo/utils/custom_dropdown.dart';
import
'package:bisaGo/utils/custom_text_field.dart'
;
import
'package:bisaGo/utils/validator.dart'
;
import
'package:carousel_slider/carousel_slider.dart'
;
import
'package:dio/dio.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter/widgets.dart'
;
import
'package:flutter_datetime_picker/flutter_datetime_picker.dart'
;
import
'package:font_awesome_flutter/font_awesome_flutter.dart'
;
import
'package:http_parser/http_parser.dart'
;
...
...
@@ -46,8 +46,8 @@ class _AddKegiatanState extends State<AddKegiatan> {
TextEditingController
linkController
=
TextEditingController
();
String
tanggalKegiatan
=
'
${DateFormat('yyyy-MM-dd
T
HH:mm').format(DateTime.now())}
'
;
'
${DateFormat('yyyy-MM-dd
HH:mm').format(DateTime.now())}
'
;
String
zonaCurrent
=
'WIB'
;
List
<
Asset
>
images
=
<
Asset
>[];
bool
permissionGranted
=
false
;
...
...
@@ -116,12 +116,21 @@ class _AddKegiatanState extends State<AddKegiatan> {
timeEnd:
DateTime
.
parse
(
tanggalKegiatan
)
.
add
(
Duration
(
days:
1
),
),
zonaWaktu:
zonaCurrent
,
);
var
newKegiatanData
=
newKegiatan
.
toJson
();
if
(
newKegiatanData
[
'zona_waktu'
]
==
'WIT'
)
{
newKegiatanData
[
'time_start'
]
=
newKegiatanData
[
'time_start'
]
+
'+0900'
;
}
else
if
(
newKegiatanData
[
'zona_waktu'
]
==
'WITA'
)
{
newKegiatanData
[
'time_start'
]
=
newKegiatanData
[
'time_start'
]
+
'+0800'
;
}
else
{
newKegiatanData
[
'time_start'
]
=
newKegiatanData
[
'time_start'
]
+
'+0700'
;
}
var
multipartImageList
=
<
MultipartFile
>[];
newKegiatanData
[
'place_id'
]
=
widget
.
placeId
;
newKegiatanData
[
'zona_waktu'
]
=
'WIB'
;
if
(
images
!=
null
)
{
for
(
var
asset
in
images
)
{
...
...
@@ -138,7 +147,7 @@ class _AddKegiatanState extends State<AddKegiatan> {
}
newKegiatanData
[
'images'
]
??=
[
''
];
final
_bloc
=
KegiatanBloc
(
widget
.
placeId
);
await
_bloc
.
addNewKegiatan
(
newKegiatanData
);
...
...
@@ -148,13 +157,13 @@ class _AddKegiatanState extends State<AddKegiatan> {
Navigator
.
pop
(
context
);
});
}
else
{
failedDialog
(
context
,
''
);
failedDialog
(
context
,
'
default
'
);
}
}
void
successDialog
(
BuildContext
context
)
{
const
alertDialog
=
AlertDialog
(
title:
Text
(
'Tambah
informasi
berhasil'
),
title:
Text
(
'Tambah
kegiatan
berhasil'
),
content:
Icon
(
FontAwesomeIcons
.
checkCircle
),
);
showDialog
(
...
...
@@ -167,7 +176,7 @@ class _AddKegiatanState extends State<AddKegiatan> {
void
failedDialog
(
BuildContext
context
,
String
message
)
{
var
newMessage
=
message
;
if
(
message
==
'default'
)
{
newMessage
=
'Gagal menambahkan
informasi
'
;
newMessage
=
'Gagal menambahkan
kegiatan
'
;
}
final
alertDialog
=
AlertDialog
(
title:
Text
(
newMessage
),
...
...
@@ -256,56 +265,54 @@ class _AddKegiatanState extends State<AddKegiatan> {
Widget
deskripsiField
()
{
return
Container
(
margin:
const
EdgeInsets
.
symmetric
(
vertical:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
10
),
child:
RichText
(
key:
Key
(
'Deskripsi Kegiatan'
),
text:
TextSpan
(
text:
'Deskripsi Kegiatan'
,
style:
const
TextStyle
(
fontSize:
18
,
color:
Colors
.
black
,
fontFamily:
'Muli'
),
children:
<
TextSpan
>[
const
TextSpan
(
text:
'*'
,
style:
TextStyle
(
color:
red
)),
],
),
),
),
TextFormField
(
key:
const
Key
(
'Text Field Deskripsi'
),
keyboardType:
TextInputType
.
multiline
,
maxLines:
null
,
minLines:
3
,
validator:
FieldValidator
.
validateInfo
,
controller:
deskripsiController
,
style:
const
TextStyle
(
fontSize:
18
,
),
decoration:
InputDecoration
(
hintStyle:
const
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
15
),
hintText:
'Tulis deskripsi...'
,
contentPadding:
const
EdgeInsets
.
all
(
8.0
),
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
10
),
borderSide:
BorderSide
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
margin:
const
EdgeInsets
.
symmetric
(
vertical:
10
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
10
),
child:
RichText
(
key:
Key
(
'Deskripsi Kegiatan'
),
text:
TextSpan
(
text:
'Deskripsi Kegiatan'
,
style:
const
TextStyle
(
fontSize:
18
,
color:
Colors
.
black
,
fontFamily:
'Muli'
),
children:
<
TextSpan
>[
const
TextSpan
(
text:
'*'
,
style:
TextStyle
(
color:
red
)),
],
),
),
),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
10
),
borderSide:
BorderSide
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
TextFormField
(
key:
const
Key
(
'Text Field Deskripsi'
),
keyboardType:
TextInputType
.
multiline
,
maxLines:
null
,
minLines:
3
,
validator:
FieldValidator
.
validateInfo
,
controller:
deskripsiController
,
style:
const
TextStyle
(
fontSize:
18
,
),
decoration:
InputDecoration
(
hintStyle:
const
TextStyle
(
fontWeight:
FontWeight
.
bold
,
fontSize:
15
),
hintText:
'Tulis deskripsi...'
,
contentPadding:
const
EdgeInsets
.
all
(
8.0
),
enabledBorder:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
10
),
borderSide:
BorderSide
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
),
),
border:
OutlineInputBorder
(
borderRadius:
BorderRadius
.
circular
(
10
),
borderSide:
BorderSide
(
color:
Theme
.
of
(
context
)
.
primaryColor
,
),
),
),
),
),
),
]
)
);
]));
}
Widget
penyelenggaraField
()
{
...
...
@@ -323,9 +330,8 @@ class _AddKegiatanState extends State<AddKegiatan> {
return
CustomTextField
(
title:
'Nama Narahubung'
,
hint:
'Masukkan nama narahubung'
,
required
:
tru
e
,
required
:
fals
e
,
key:
const
Key
(
'Text Field Nama Narahubung'
),
validator:
FieldValidator
.
validateName
,
controller:
namaKontakController
,
);
}
...
...
@@ -336,7 +342,7 @@ class _AddKegiatanState extends State<AddKegiatan> {
hint:
'Masukkan nomor telepon narahubung'
,
required
:
true
,
key:
const
Key
(
'Text Field Nomor Telepon Narahubung'
),
validator:
FieldValidator
.
validate
Name
,
validator:
FieldValidator
.
validate
Info
,
controller:
nomorKontakController
,
);
}
...
...
@@ -352,61 +358,88 @@ class _AddKegiatanState extends State<AddKegiatan> {
}
Widget
tanggalKegiatanField
()
{
return
Padding
(
return
Container
(
padding:
const
EdgeInsets
.
only
(
bottom:
16
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
child:
Column
(
children:
<
Widget
>[
SizedBox
(
height:
10.0
),
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
2
0
,
10
),
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
7
0
,
10
),
child:
const
Text
(
'Tanggal Kegiatan'
,
'Tanggal
& Waktu
Kegiatan'
,
style:
TextStyle
(
fontSize:
18
),
textAlign:
TextAlign
.
left
,
),
),
TextButton
(
key:
const
Key
(
'Button Tanggal Kegiatan'
),
style:
TextButton
.
styleFrom
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10.0
)),
padding:
const
EdgeInsets
.
all
(
13.0
),
backgroundColor:
greenPrimary
,
),
onPressed:
()
{
DatePicker
.
showDateTimePicker
(
context
,
currentTime:
DateTime
.
parse
(
tanggalKegiatan
),
onChanged:
(
date
)
{
setState
(()
{
tanggalKegiatan
=
'
${DateFormat('yyyy-MM-ddTHH:mm').format(date)}
'
;
});
},
);
},
child:
Text
(
tanggalKegiatan
,
style:
const
TextStyle
(
fontSize:
15.0
,
color:
Colors
.
white
),
Row
(
children:
<
Widget
>[
// SizedBox(
// width: 186.0,
Expanded
(
child:
TextButton
(
key:
const
Key
(
'Button Tanggal & Waktu Kegiatan'
),
style:
TextButton
.
styleFrom
(
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10.0
)),
padding:
const
EdgeInsets
.
all
(
13.0
),
backgroundColor:
Colors
.
transparent
,
side:
BorderSide
(
color:
greenPrimary
),
),
onPressed:
()
{
DatePicker
.
showDateTimePicker
(
context
,
currentTime:
DateTime
.
parse
(
tanggalKegiatan
),
onChanged:
(
date
)
{
setState
(()
{
tanggalKegiatan
=
'
${DateFormat('yyyy-MM-dd HH:mm').format(date)}
'
;
});
},
);
},
child:
Row
(
children:
<
Widget
>[
Icon
(
Icons
.
calendar_today
,
size:
20
,
color:
Colors
.
green
,
),
SizedBox
(
width:
10.0
),
Text
(
tanggalKegiatan
,
style:
const
TextStyle
(
fontSize:
15.0
,
color:
Colors
.
black
),
),
])
),
),
),
// CustomDropdown(
// title: 'Fasilitas / Layanan',
// key: const Key('Dropdown Fasilitas Layanan'),
// dropdownList: zonaWaktu,
// validator: FieldValidator.validateDropdown,
// hint: 'Pilih fasilitas / layanan',
// onChanged: (value) {
// setState(() {
// _blombikinstringnya = value;
// });
// }),
SizedBox
(
width:
15.0
),
zonaWaktuChoice
(),
]),
],
),
);
}
Widget
zonaWaktuChoice
()
{
return
DropdownButton
<
String
>(
value:
zonaCurrent
,
underline:
Container
(
height:
1
,
color:
Colors
.
green
,
),
items:
zonaWaktu
.
map
((
String
zona
)
{
return
DropdownMenuItem
<
String
>(
value:
zona
,
child:
Text
(
zona
),
);
})
.
toList
(),
onChanged:
(
String
zonaSelected
)
{
setState
(()
{
zonaCurrent
=
zonaSelected
;
});
},
);
}
Widget
fotoField
()
{
return
Padding
(
padding:
const
EdgeInsets
.
only
(
bottom:
16
),
...
...
@@ -427,7 +460,6 @@ class _AddKegiatanState extends State<AddKegiatan> {
onPressed:
()
async
{
await
pickImages
();
},
child:
Container
(
// width: MediaQuery.of(context).size.width * 0.35,
padding:
const
EdgeInsets
.
all
(
9.0
),
...
...
@@ -446,8 +478,7 @@ class _AddKegiatanState extends State<AddKegiatan> {
const
SizedBox
(
width:
regularSpace
),
const
Text
(
'Tambah foto '
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
14.0
),
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
14.0
),
),
],
),
...
...
@@ -460,21 +491,18 @@ class _AddKegiatanState extends State<AddKegiatan> {
Widget
simpanButton
()
{
return
Container
(
margin:
const
EdgeInsets
.
only
(
top:
doubleSpace
),
alignment:
Alignment
.
center
,
child:
ButtonTheme
(
key:
const
Key
(
'Button Simpan'
),
minWidth:
double
.
infinity
,
height:
40
,
child:
submitButton
(
'Simpan'
,
_submitData
),
)
);
margin:
const
EdgeInsets
.
only
(
top:
doubleSpace
),
alignment:
Alignment
.
center
,
child:
ButtonTheme
(
key:
const
Key
(
'Button Simpan'
),
minWidth:
double
.
infinity
,
height:
40
,
child:
submitButton
(
'Simpan'
,
_submitData
),
));
}
Widget
_showImagePreview
()
{
return
images
.
isEmpty
?
const
SizedBox
(
height:
0
)
:
carousel
();
return
images
.
isEmpty
?
const
SizedBox
(
height:
0
)
:
carousel
();
}
Widget
carousel
()
{
...
...
@@ -482,58 +510,57 @@ class _AddKegiatanState extends State<AddKegiatan> {
width:
MediaQuery
.
of
(
context
)
.
size
.
width
,
height:
160
,
child:
CarouselSlider
(
options:
CarouselOptions
(
aspectRatio:
1.0
,
enlargeCenterPage:
true
,
enableInfiniteScroll:
false
,
initialPage:
0
,
autoPlay:
true
,
),
items:
images
.
map
((
item
)
=
>
Container
(
child:
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
20
)),
child:
Stack
(
children:
<
Widget
>[
AssetThumb
(
asset:
item
,
width:
MediaQuery
.
of
(
context
)
.
size
.
height
.
toInt
(),
height:
MediaQuery
.
of
(
context
)
.
size
.
width
.
toInt
(),
),
Positioned
(
bottom:
0.0
,
left:
0.0
,
right:
0.0
,
child:
Container
(
decoration:
BoxDecoration
(
gradient:
LinearGradient
(
colors:
[
Color
.
fromARGB
(
200
,
0
,
0
,
0
),
Color
.
fromARGB
(
0
,
0
,
0
,
0
)
options:
CarouselOptions
(
aspectRatio:
1.0
,
enlargeCenterPage:
true
,
enableInfiniteScroll:
false
,
initialPage:
0
,
autoPlay:
true
,
),
items:
images
.
map
(
(
item
)
=
>
Container
(
child:
ClipRRect
(
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
20
)),
child:
Stack
(
children:
<
Widget
>[
AssetThumb
(
asset:
item
,
width:
MediaQuery
.
of
(
context
)
.
size
.
height
.
toInt
(),
height:
MediaQuery
.
of
(
context
)
.
size
.
width
.
toInt
(),
),
Positioned
(
bottom:
0.0
,
left:
0.0
,
right:
0.0
,
child:
Container
(
decoration:
BoxDecoration
(
gradient:
LinearGradient
(
colors:
[
Color
.
fromARGB
(
200
,
0
,
0
,
0
),
Color
.
fromARGB
(
0
,
0
,
0
,
0
)
],
begin:
Alignment
.
bottomCenter
,
end:
Alignment
.
topCenter
,
),
),
padding:
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
20.0
),
child:
Text
(
'#
${images.indexOf(item) + 1}
'
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20.0
,
fontWeight:
FontWeight
.
bold
,
),
),
),
),
],
begin:
Alignment
.
bottomCenter
,
end:
Alignment
.
topCenter
,
),
),
padding:
EdgeInsets
.
symmetric
(
vertical:
10.0
,
horizontal:
20.0
),
child:
Text
(
'#
${images.indexOf(item) + 1}
'
,
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
20.0
,
fontWeight:
FontWeight
.
bold
,
),
),
),
)),
),
],
)
),
),
)
.
toList
()),
)
.
toList
()),
);
}
}
lib/page/filter_fasilitas/postingan/detail_post_kegiatan.dart
View file @
9282aef8
...
...
@@ -89,7 +89,7 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Container
(
width:
MediaQuery
.
of
(
context
)
.
size
.
width
*
0.
6
,
width:
MediaQuery
.
of
(
context
)
.
size
.
width
*
0.
8
,
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
<
Widget
>[
...
...
@@ -220,7 +220,7 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
.
toList
(),
),
),
const
SizedBox
(
height:
10
),
SizedBox
(
height:
10
),
Container
(
key:
const
Key
(
'desc'
),
padding:
const
EdgeInsets
.
all
(
doubleSpace
),
...
...
@@ -237,12 +237,12 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
SizedBox
(
height:
20
),
Row
(
children:
[
const
Icon
(
Icon
(
Icons
.
calendar_today
,
size:
20
,
color:
Colors
.
green
,
),
const
SizedBox
(
width:
15
),
SizedBox
(
width:
15
),
Text
(
'
${DateFormat('EEEEEE, dd MMM yyy').format(widget.kegiatan.timeStart)}
'
,
style:
TextStyle
(
fontSize:
16
),
...
...
@@ -253,41 +253,49 @@ class _DetailPostKegiatanPageState extends State<DetailPostKegiatanPage> {
SizedBox
(
height:
15
),
Row
(
children:
[
const
Icon
(
Icon
(
Icons
.
access_time
,
size:
20
,
color:
Colors
.
green
,
),
const
SizedBox
(
width:
15
),
SizedBox
(
width:
15
),
Text
(
'
${DateFormat('
hh
:mm').format(widget.kegiatan.timeStart)}
'
,
'
${DateFormat('
HH
:mm').format(widget.kegiatan.timeStart)}
'
,
style:
TextStyle
(
fontSize:
16
),
key:
Key
(
'Text Waktu Pelaksanaan'
),
),
SizedBox
(
width:
3.0
),
Text
(
widget
.
kegiatan
.
zonaWaktu
,
style:
TextStyle
(
fontSize:
16
),
key:
Key
(
'Text Zona Waktu Pelaksanaan'
),
)
],
),
Row
(
children:
[
const
Icon
(
Icon
(
Icons
.
call
,
size:
20
,
color:
Colors
.
green
,
),
const
SizedBox
(
width:
7
.0
),
SizedBox
(
width:
15
.0
),
Text
(
'
${
widget.kegiatan.namaKontak
}
'
,
widget
.
kegiatan
.
namaKontak
??
'
'
,