Fakultas Ilmu Komputer UI

kegiatan.dart 3.96 KB
Newer Older
1
import 'package:bisaGo/config/styles.dart';
2
import 'package:bisaGo/model/lokasi.dart';
3
4
import 'package:bisaGo/model/kegiatan.dart';
import 'package:bisaGo/page/filter_fasilitas/postingan/detail_post_kegiatan.dart';
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import 'package:flutter/material.dart';
// import 'package:bisaGo/component/image_holder.dart';

class Kegiatan extends StatefulWidget {
  final Lokasi lokasi;
  final KegiatanModel kegiatan;

  const Kegiatan({@required this.kegiatan, @required this.lokasi, Key key})
      : super(key: key);
  @override
  _KegiatanState createState() => _KegiatanState();
}

class _KegiatanState extends State<Kegiatan> {

  @override
  Widget build(BuildContext context) {
    return InkWell(
jovi_013's avatar
jovi_013 committed
23
        key: Key(widget.kegiatan.namaKegiatan),
24
25
26
27
28
29
        onTap: () {
          Navigator.of(context).pushReplacement(MaterialPageRoute(
              builder: (BuildContext context) => DetailPostKegiatanPage(
                lokasi: widget.lokasi,
                kegiatan: KegiatanModel(
                  id: widget.kegiatan.id,
jovi_013's avatar
jovi_013 committed
30
                  placeId: widget.kegiatan.placeId,
31
32
33
34
35
                  creator: widget.kegiatan.creator,
                  namaKegiatan: widget.kegiatan.namaKegiatan,
                  penyelenggara: widget.kegiatan.penyelenggara,
                  narahubung: widget.kegiatan.narahubung,
                  deskripsi: widget.kegiatan.deskripsi,
jovi_013's avatar
jovi_013 committed
36
37
                  // timeStart: widget.kegiatan.timeStart,
                  // timeEnd: widget.kegiatan.timeEnd,
38
39
40
41
                ),
              )
          ));
        },
42
43
44
45
46
47
        child: Container(
          margin: const EdgeInsets.only(bottom: regularSpace),
          padding: const EdgeInsets.all(doubleSpace),
          decoration: BoxDecoration(
            boxShadow: regularShadow,
            border: Border.all(width: 2, color: greenPrimary.withOpacity(0.4)),
jovi_013's avatar
jovi_013 committed
48
            borderRadius: const BorderRadius.all(Radius.circular(10)),
49
50
51
52
53
54
55
56
57
58
59
60
            color: Colors.white,
          ),
          child: Stack(
            children: <Widget>[
              Column(
                children: <Widget>[
                  Container(
                    margin: const EdgeInsets.only(bottom: regularSpace),
                    child: Row(
                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
                      children: <Widget>[
                        Text(
jovi_013's avatar
jovi_013 committed
61
                          widget.kegiatan.namaKegiatan,
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
                          style: const TextStyle(
                            fontSize: 16,
                            fontWeight: FontWeight.w800,
                            color: Colors.black,
                            fontFamily: 'Muli',
                          ),
                        ),
                      ],
                    ),
                  ),
                  Container(
                    margin: const EdgeInsets.only(bottom: regularSpace),
                    child: SizedBox(
                      height: 160,
                      // child: ImageHolder(
                      //   url: widget.kegiatan.image,
                      //   fasilitas: widget.kegiatan.tag
                      // )
                      child: Text('Image here'),
                    )
                  ),
                  Row(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    mainAxisAlignment: MainAxisAlignment.end,
                    children: <Widget>[
                      Flexible(
                        child: Text(
jovi_013's avatar
jovi_013 committed
89
                          'ditambahkan oleh ${widget.kegiatan.creator}',
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
                          softWrap: true,
                          style: const TextStyle(
                            fontSize: 12,
                            color: Colors.black,
                            fontFamily: 'Muli',
                            fontStyle: FontStyle.italic,
                          ),
                        ),
                      ),
                    ],
                  ),
                ],
              ),
            ],
          ),
        ));
  }
}