Fakultas Ilmu Komputer UI

Commit 562c3636 authored by Yoga Pratama's avatar Yoga Pratama
Browse files

[CHORES] Remove WillPopScope

parent ea73f9b5
Pipeline #78361 failed with stages
in 1 minute and 37 seconds
......@@ -17,29 +17,27 @@ class Kegiatan extends StatefulWidget {
}
class _KegiatanState extends State<Kegiatan> {
@override
Widget build(BuildContext context) {
return InkWell(
key: Key(widget.kegiatan.namaKegiatan),
onTap: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => DetailPostKegiatanPage(
lokasi: widget.lokasi,
kegiatan: KegiatanModel(
id: widget.kegiatan.id,
placeId: widget.kegiatan.placeId,
creator: widget.kegiatan.creator,
namaKegiatan: widget.kegiatan.namaKegiatan,
penyelenggara: widget.kegiatan.penyelenggara,
narahubung: widget.kegiatan.narahubung,
deskripsi: widget.kegiatan.deskripsi,
timeStart: widget.kegiatan.timeStart,
timeEnd: widget.kegiatan.timeEnd,
image: widget.kegiatan.image,
),
)
));
lokasi: widget.lokasi,
kegiatan: KegiatanModel(
id: widget.kegiatan.id,
placeId: widget.kegiatan.placeId,
creator: widget.kegiatan.creator,
namaKegiatan: widget.kegiatan.namaKegiatan,
penyelenggara: widget.kegiatan.penyelenggara,
narahubung: widget.kegiatan.narahubung,
deskripsi: widget.kegiatan.deskripsi,
timeStart: widget.kegiatan.timeStart,
timeEnd: widget.kegiatan.timeEnd,
image: widget.kegiatan.image,
),
)));
},
child: Container(
margin: const EdgeInsets.only(bottom: regularSpace),
......@@ -72,59 +70,68 @@ class _KegiatanState extends State<Kegiatan> {
),
),
Container(
margin: const EdgeInsets.only(bottom: regularSpace),
child: SizedBox(
width: MediaQuery.of(context).size.width,
height: 160,
child: CarouselSlider(
options: CarouselOptions(
aspectRatio: 1.0,
enlargeCenterPage: true,
enableInfiniteScroll: false,
initialPage: 0,
autoPlay: true,
),
items: widget.kegiatan.image.map((item) => Container(
child: Container(
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(20)),
child: Stack(
children: <Widget>[
Image.network(item, fit: BoxFit.cover, width: 1000.0),
Positioned(
bottom: 0.0,
left: 0.0,
right: 0.0,
margin: const EdgeInsets.only(bottom: regularSpace),
child: SizedBox(
width: MediaQuery.of(context).size.width,
height: 160,
child: CarouselSlider(
options: CarouselOptions(
aspectRatio: 1.0,
enlargeCenterPage: true,
enableInfiniteScroll: false,
initialPage: 0,
autoPlay: true,
),
items: widget.kegiatan.image
.map((item) => Container(
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(
'#${widget.kegiatan.image.indexOf(item)+1}',
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight: FontWeight.bold,
),
),
child: ClipRRect(
borderRadius: BorderRadius.all(
Radius.circular(20)),
child: Stack(
children: <Widget>[
Image.network(item,
fit: BoxFit.cover,
width: 1000.0),
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(
'#${widget.kegiatan.image.indexOf(item) + 1}',
style: TextStyle(
color: Colors.white,
fontSize: 20.0,
fontWeight:
FontWeight.bold,
),
),
),
),
],
)),
),
),
],
)
),
),
)).toList(),
),
)
),
))
.toList(),
),
)),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.end,
......@@ -148,5 +155,5 @@ class _KegiatanState extends State<Kegiatan> {
],
),
));
}
}
\ No newline at end of file
}
}
......@@ -37,7 +37,7 @@ class _KomentarState extends State<Komentar> {
return InkWell(
key: Key('Fasilitas ${fasilitas[widget.komentar.tag]}'),
onTap: () {
Navigator.of(context).pushReplacement(MaterialPageRoute(
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => DetailPostPage(
lokasi: widget.lokasi,
komentar: KomentarModel(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment