Fakultas Ilmu Komputer UI

Commit 6808f204 authored by Fakhira Devina's avatar Fakhira Devina
Browse files

[GREEN] detail post page

- still waiting for comment on postingan API and fix picture
parent d56c87c1
Pipeline #40714 passed with stages
in 7 minutes and 59 seconds
{"_info":"// This is a generated file; do not edit or check into version control.","dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"google_maps_flutter","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"sqflite","dependencies":[]}]}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"google_maps_flutter","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.24+1\\\\","dependencies":[]},{"name":"location","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.5.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.5\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.3.0\\\\","dependencies":[]}],"android":[{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-1.0.6\\\\","dependencies":[]},{"name":"google_maps_flutter","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\google_maps_flutter-0.5.24+1\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\location-2.5.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-1.6.5\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.3.0\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-0.0.4\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\Flutter\\\\flutter_windows_v1.9.1+hotfix.2-stable\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-1.3.0\\\\","dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"google_maps_flutter","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"location","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos"]},{"name":"path_provider_macos","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2020-04-16 14:34:00.434107","version":"1.15.17"}
\ No newline at end of file
......@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/config/styles.dart';
class BisaGoAppBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
BisaGoAppBar({this.title = 'bisaGo', Key key}) : super(key: key);
@override
final Size preferredSize = const Size.fromHeight(55);
@override
......@@ -16,7 +18,7 @@ class BisaGoAppBar extends StatelessWidget implements PreferredSizeWidget {
children: <Widget>[
Padding(padding: EdgeInsets.all(doubleSpace),
child: Text(
"bisaGo",
title,
style: TextStyle(
fontSize: 25,
fontFamily: 'Comfortaa',
......
......@@ -13,4 +13,24 @@ setKey(String newKey) {
setSessionId(String newSessionId) {
sessionId = newSessionId;
}
final tags = {
'KR': 'kursiroda',
'LF': 'liftdisabilitas',
'TD': 'toiletdisabilitas',
'MM': 'masjid',
'GB': 'guidingblock',
'BM': 'bidangmiring',
'CP': 'temandisabilitas',
'JI': 'jurubahasaisyarat',
'TN': 'tongkatdisabilitasnetra',
'KD': 'kursiumumdisabilitas',
'PK': 'tempatparkirdisabilitas',
'RT': 'runningtext',
'TB': 'tempatparkirbiasa'
};
getTag(String tag) {
return tags[tag];
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
const Color greenPrimary = Color(0xff3A903A);
const Color greenPale = Color(0xff4FBA4F);
const Color redPrimary = Color(0xffC60000);
const Color grayPrimary = Color(0xff645C5C);
const double superSmallSpace = 4.0;
const double smallSpace = 4.0;
......
......@@ -39,7 +39,7 @@ class _FasilitasState extends State<Fasilitas> {
_bloc = KomentarBloc(widget.nama);
super.initState();
}
@override
Widget build(BuildContext context) {
print('widget.telpon ${widget.url}');
......@@ -198,25 +198,12 @@ class _FasilitasState extends State<Fasilitas> {
break;
case Status.COMPLETED:
final komentar = snapshot.data.data;
print("IN FASILITAs");
print(komentar.allKomentar[0].deskripsi);
return ListView.builder(
shrinkWrap: true,
itemCount: komentar.allKomentar.length,
itemBuilder: (BuildContext context, int index) {
return Komentar(
dislike:
komentar.allKomentar[index].dislike,
komentar: komentar.allKomentar[index].deskripsi,
like: komentar.allKomentar[index].like,
tags:komentar.allKomentar[index].tag,
urlImage: [
komentar.allKomentar[index].image
],
user:
komentar.allKomentar[index].creator,
);
});
return Column(
children: komentar
.allKomentar.map<Widget>((k) => Komentar(
komentar: k,
))
.toList());
break;
case Status.ERROR:
return Center(
......@@ -239,7 +226,7 @@ class _FasilitasState extends State<Fasilitas> {
),
);
}
InsideFilter() {
return StatefulBuilder(
builder: (context, setStateModal) => Container(
......@@ -248,7 +235,7 @@ class _FasilitasState extends State<Fasilitas> {
boxShadow: regularShadow,
borderRadius: BorderRadius.all(
Radius.circular(10) // <--- border radius here
),
),
color: Colors.white,
),
child: Container(
......@@ -327,15 +314,15 @@ class _FasilitasState extends State<Fasilitas> {
splashColor: Colors.green[400],
highlightColor: Colors.green[400],
onTap: () => setStateModal(() {
print('no');
showUrutan = true;
})),
print('no');
showUrutan = true;
})),
Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(
color: greenPrimary, width: 1.5),
)),
top: BorderSide(
color: greenPrimary, width: 1.5),
)),
),
InkWell(
child: Container(
......@@ -359,9 +346,9 @@ class _FasilitasState extends State<Fasilitas> {
splashColor: Colors.green[400],
highlightColor: Colors.green[400],
onTap: () => setStateModal(() {
print("yes");
showUrutan = false;
})),
print("yes");
showUrutan = false;
})),
Container(
decoration: BoxDecoration(
border: Border(
......@@ -389,7 +376,7 @@ class _FasilitasState extends State<Fasilitas> {
children: <Widget>[
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -416,7 +403,7 @@ class _FasilitasState extends State<Fasilitas> {
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -444,12 +431,12 @@ class _FasilitasState extends State<Fasilitas> {
Container(
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
unselectedWidgetColor:
greenPrimary,
greenPrimary,
),
child: Checkbox(
checkColor: Colors.red,
......@@ -482,7 +469,7 @@ class _FasilitasState extends State<Fasilitas> {
children: <Widget>[
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -509,7 +496,7 @@ class _FasilitasState extends State<Fasilitas> {
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -536,7 +523,7 @@ class _FasilitasState extends State<Fasilitas> {
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -563,7 +550,7 @@ class _FasilitasState extends State<Fasilitas> {
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -590,7 +577,7 @@ class _FasilitasState extends State<Fasilitas> {
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -617,7 +604,7 @@ class _FasilitasState extends State<Fasilitas> {
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -644,7 +631,7 @@ class _FasilitasState extends State<Fasilitas> {
),
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[
Theme(
data: Theme.of(context).copyWith(
......@@ -686,12 +673,12 @@ class _FasilitasState extends State<Fasilitas> {
Container(
decoration: BoxDecoration(
border: Border(
top: BorderSide(color: greenPrimary, width: 1.5),
)),
top: BorderSide(color: greenPrimary, width: 1.5),
)),
),
Container(
margin:
EdgeInsets.only(left: doubleSpace, right: doubleSpace),
EdgeInsets.only(left: doubleSpace, right: doubleSpace),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
......
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/config/strings.dart';
import 'package:ppl_disabilitas/config/styles.dart';
import 'package:ppl_disabilitas/model/komentar.dart';
import 'package:ppl_disabilitas/page/filter_fasilitas/postingan/detailpost.dart';
class Komentar extends StatefulWidget {
final String user;
final int like;
final int dislike;
final List<String> urlImage;
final String komentar;
final List<String> tags;
final KomentarModel komentar;
Komentar(
{@required this.user,
@required this.like,
@required this.dislike,
@required this.urlImage,
@required this.komentar,
@required this.tags});
Komentar({@required this.komentar});
@override
_KomentarState createState() => _KomentarState();
}
......@@ -23,97 +15,106 @@ class Komentar extends StatefulWidget {
class _KomentarState extends State<Komentar> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(bottom: regularSpace),
padding: EdgeInsets.all(doubleSpace),
decoration: BoxDecoration(
boxShadow: regularShadow,
border: Border.all(width: 2, color: greenPrimary.withOpacity(0.4)),
borderRadius: BorderRadius.all(
Radius.circular(10) // <--- border radius here
),
color: Colors.white,
),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: regularSpace),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
widget.user,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w800,
color: Colors.black,
fontFamily: 'Muli',
return InkWell(
onTap: () {
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => DetailPostPage(
komentar: widget.komentar,
)));
},
child: Container(
margin: EdgeInsets.only(bottom: regularSpace),
padding: EdgeInsets.all(doubleSpace),
decoration: BoxDecoration(
boxShadow: regularShadow,
border: Border.all(width: 2, color: greenPrimary.withOpacity(0.4)),
borderRadius: BorderRadius.all(
Radius.circular(10) // <--- border radius here
),
color: Colors.white,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: regularSpace),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
widget.komentar.creator,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w800,
color: Colors.black,
fontFamily: 'Muli',
),
),
),
Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(right: regularSpace),
child: Row(
children: <Widget>[
Icon(Icons.thumb_up,
color: Colors.green[800], size: 20),
Text(
'${widget.like} suka',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Colors.green[800],
Row(
children: <Widget>[
Container(
margin: EdgeInsets.only(right: regularSpace),
child: Row(
children: <Widget>[
Icon(Icons.thumb_up,
color: Colors.green[800], size: 20),
Text(
'${widget.komentar.like} suka',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Colors.green[800],
),
),
),
],
)),
Icon(Icons.thumb_down, color: redPrimary, size: 20),
Text(
'${widget.dislike} tidak suka',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: redPrimary,
],
)),
Icon(Icons.thumb_down, color: redPrimary, size: 20),
Text(
'${widget.komentar.dislike} tidak suka',
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: redPrimary,
),
),
),
],
)
],
],
)
],
),
),
),
Container(
margin: EdgeInsets.only(bottom: regularSpace),
child: ClipRRect(
borderRadius: BorderRadius.circular(5),
child: Image.asset('assets/images/disabletoilet.jpg'),
)),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Flexible(
child: Text(
widget.komentar,
softWrap: true,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 15,
color: Colors.black,
fontFamily: 'Muli',
Container(
margin: EdgeInsets.only(bottom: regularSpace),
child: ClipRRect(
borderRadius: BorderRadius.circular(5),
child: Image.asset('assets/images/disabletoilet.jpg'),
)),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Flexible(
child: Text(
widget.komentar.deskripsi,
softWrap: true,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 15,
color: Colors.black,
fontFamily: 'Muli',
),
),
),
),
],
),
Row(
children: <Widget>[
...widget.tags.map<Widget>((tag) {
return _tag(tag);
}).toList()
],
),
],
));
],
),
Wrap(
children: <Widget>[
...widget.komentar.tag.map<Widget>((tag) {
return _tag(tag);
}).toList()
],
),
],
)),
);
}
Widget _tag(String tag) {
......@@ -129,7 +130,7 @@ class _KomentarState extends State<Komentar> {
color: Colors.white,
),
child: Text(
tag,
'#${getTag(tag)}',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w800,
......
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:ppl_disabilitas/component/ImageHolder.dart';
import 'package:ppl_disabilitas/component/bisago_appbar.dart';
import 'package:ppl_disabilitas/config/strings.dart';
import 'package:ppl_disabilitas/config/styles.dart';
import 'package:ppl_disabilitas/model/komentar.dart';
class DetailPostPage extends StatefulWidget {
final KomentarModel komentar;
DetailPostPage({@required this.komentar});
@override
_DetailPostPageState createState() => _DetailPostPageState();
}
class _DetailPostPageState extends State<DetailPostPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: BisaGoAppBar(
title: widget.komentar.nama_lokasi,
key: Key('appbar-text-${widget.komentar.nama_lokasi}'),
),
body: Container(
margin: EdgeInsets.all(doubleSpace),
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
ImageHolder(url: widget.komentar.image),
Wrap(
alignment: WrapAlignment.start,
direction: Axis.horizontal,
crossAxisAlignment: WrapCrossAlignment.start,
children: widget.komentar.tag
.map<Widget>((tag) => _createTagContainer(getTag(tag)))
.toList(),
),
Container(
key: Key('desc'),
decoration: BoxDecoration(
color: Colors.white,
boxShadow: regularShadow,
border: Border.all(color: greenPale),
borderRadius: regularBorderRadius),
padding: EdgeInsets.all(doubleSpace),
margin: EdgeInsets.symmetric(vertical: regularSpace),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Informasi',
style:
TextStyle(fontSize: 20, fontWeight: FontWeight.w800),
),
Container(
margin: EdgeInsets.symmetric(vertical: regularSpace),
child: Text(
widget.komentar.deskripsi,
style: TextStyle(fontSize: 18),
),
),
Container(
margin: EdgeInsets.symmetric(vertical: regularSpace),
child: Text(
'Diposting oleh',
style: TextStyle(fontSize: 18),
),
),
Text(
'${widget.komentar.creator}',
key: Key('creator-${widget.komentar.creator}'),
),
Text(
'${DateFormat('dd MMMM yyy hh:mm').format(widget.komentar.date_time)}',
style: TextStyle(color: grayPrimary, fontSize: 16),
key: Key('timestamp'),
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
child: Container(
key: Key('like'),
decoration: BoxDecoration(
color: greenPrimary,
borderRadius: regularBorderRadius,
boxShadow: regularShadow),
padding: EdgeInsets.all(smallSpace),
margin: EdgeInsets.symmetric(horizontal: smallSpace),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.thumb_up,
color: Colors.white,
),
Text(