Fakultas Ilmu Komputer UI

Commit 3f42d71a authored by Fakhira Devina's avatar Fakhira Devina
Browse files

Merge branch 'PBI-5-daftar_layanan_fasilitas_publik' into staging

parents 7a80068e a722fd15
Pipeline #38682 passed with stages
in 26 minutes and 10 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":[]}]}
\ 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-07 01:43:57.541241","version":"1.15.17"}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/page/dashboard/dashboard.dart';
//import 'package:ppl_disabilitas/page/filter & fasilitas/fasilitas.dart';
class BisaGo extends StatelessWidget {
@override
......
import 'dart:async';
import 'package:ppl_disabilitas/model/komentar.dart';
import 'package:ppl_disabilitas/network/data/network_model.dart';
import 'package:ppl_disabilitas/repository/KomentarRepository.dart';
class KomentarBloc {
KomentarRepository _komentarRepository;
StreamController _komentarListController;
StreamSink<NetworkModel<KomentarList>> get komentarListSink =>
_komentarListController.sink;
Stream<NetworkModel<KomentarList>> get komentarListStream =>
_komentarListController.stream;
KomentarBloc() {
_komentarListController = StreamController<NetworkModel<KomentarList>>();
_komentarRepository = KomentarRepository();
fetchKomentarList();
}
fetchKomentarList() async {
komentarListSink.add(NetworkModel.loading('Getting Komentar'));
try {
KomentarList komentarListResponse =
await _komentarRepository.fetchKomentar();
komentarListSink.add(NetworkModel.completed(komentarListResponse));
} catch (e) {
komentarListSink.add(NetworkModel.error(e.toString()));
print("$e");
}
}
dispose() {
_komentarListController?.close();
}
}
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
class ImageHolder extends StatelessWidget {
final String url;
ImageHolder({@required this.url});
@override
Widget build(BuildContext context) {
return CachedNetworkImage(
imageUrl: url,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
image: DecorationImage(image: imageProvider, fit: BoxFit.fill)),
),
placeholder: (context, _) =>
const Center(child: CircularProgressIndicator()),
errorWidget: (context, url, error) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/margocity.png'),
fit: BoxFit.scaleDown)),
),
);
}
}
class CustomSerializer {
static DateTime stringToDateTime(String date) => DateTime.parse(date);
}
import 'package:flutter/material.dart';
final Color greenPrimary = Color(0xff3A903A);
final Color greenPale = Color(0xff4FBA4F);
final Color redPrimary = Color(0xffC60000);
final Color bluePrimary = Color(0xff537AC6);
final double superSmallSpace = 4.0;
final double smallSpace = 4.0;
final double regularSpace = 8.0;
final double regularBiggerSpace = 12.0;
final double doubleSpace = 16.0;
final double tripleSpace = 32.0;
final double spaceFourty = 45.0;
final double quartetSpace = 64.0;
final double spaceFourtyEight = 48.0;
final List<BoxShadow> regularShadow = [
BoxShadow(
blurRadius: 4,
color: Colors.black.withOpacity(0.25),
offset: Offset(0, 0))
color: Colors.black.withOpacity(0.25),
blurRadius: 7.0, // has the effect of softening the shadow
offset: Offset(
5.0, // horizontal, move right 10
5.0, // vertical, movesn down 10
),
)
];
final List<BoxShadow> smallShadow = [
BoxShadow(
color: Colors.black.withOpacity(0.25),
blurRadius: 2.0, // has the effect of softening the shadow
offset: Offset(
1.5, // horizontal, move right 10
1.5, // vertical, move down 10
),
)
];
final BorderRadius regularBorderRadius = BorderRadius.circular(10);
final BorderRadius doubleBorderRadius = BorderRadius.circular(20);
import 'package:json_annotation/json_annotation.dart';
part 'komentar.g.dart';
@JsonSerializable()
class KomentarList {
final List<KomentarModel> allKomentar;
KomentarList(this.allKomentar);
}
@JsonSerializable()
class KomentarModel {
final String nama_orang;
final int suka;
final int tidak_suka;
final String foto;
KomentarModel(
{this.nama_orang, this.suka, this.tidak_suka, this.foto});
factory KomentarModel.fromJson(Map<String, dynamic> json) => _$KomentarModelFromJson(json);
Map<String, dynamic> toJson() => _$KomentarModelToJson(this);
}
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'komentar.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
KomentarList _$KomentarListFromJson(Map<String, dynamic> json) {
return KomentarList(
(json['allKomentar'] as List)
?.map((e) => e == null
? null
: KomentarModel.fromJson(e as Map<String, dynamic>))
?.toList(),
);
}
Map<String, dynamic> _$KomentarListToJson(KomentarList instance) =>
<String, dynamic>{
'allKomentar': instance.allKomentar,
};
KomentarModel _$KomentarModelFromJson(Map<String, dynamic> json) {
return KomentarModel(
nama_orang: json['nama_orang'] as String,
suka: json['suka'] as int,
tidak_suka: json['tidak_suka'] as int,
foto: json['foto'] as String,
);
}
Map<String, dynamic> _$KomentarModelToJson(KomentarModel instance) =>
<String, dynamic>{
'nama_orang': instance.nama_orang,
'suka': instance.suka,
'tidak_suka': instance.tidak_suka,
'foto': instance.foto,
};
......@@ -4,9 +4,7 @@ part 'lokasi.g.dart';
class LokasiListResponse {
List<Lokasi> listLokasi;
LokasiListResponse();
factory LokasiListResponse.fromJson(List json) => _$LokasiListResponseFromJson(json);
Map<String, dynamic> toJson() => _$LokasiListResponseToJson(this);
LokasiListResponse(this.listLokasi);
}
@JsonSerializable(nullable: true)
......@@ -16,7 +14,7 @@ class Lokasi {
double longitude;
String alamat;
String foto;
String telp;
String telepon;
Lokasi();
......
......@@ -6,12 +6,13 @@ part of 'lokasi.dart';
// JsonSerializableGenerator
// **************************************************************************
LokasiListResponse _$LokasiListResponseFromJson(List json) {
return LokasiListResponse()
..listLokasi = json
LokasiListResponse _$LokasiListResponseFromJson(Map<String, dynamic> json) {
return LokasiListResponse(
(json['listLokasi'] as List)
?.map((e) =>
e == null ? null : Lokasi.fromJson(e as Map<String, dynamic>))
?.toList();
?.toList(),
);
}
Map<String, dynamic> _$LokasiListResponseToJson(LokasiListResponse instance) =>
......@@ -19,7 +20,6 @@ Map<String, dynamic> _$LokasiListResponseToJson(LokasiListResponse instance) =>
'listLokasi': instance.listLokasi,
};
Lokasi _$LokasiFromJson(Map<String, dynamic> json) {
return Lokasi()
..nama = json['nama'] as String
......@@ -27,14 +27,14 @@ Lokasi _$LokasiFromJson(Map<String, dynamic> json) {
..longitude = (json['longitude'] as num)?.toDouble()
..alamat = json['alamat'] as String
..foto = json['foto'] as String
..telp = json['telp'] as String;
..telepon = json['telepon'] as String;
}
Map<String, dynamic> _$LokasiToJson(Lokasi instance) => <String, dynamic>{
'nama': instance.nama,
'latitude': instance.latitude,
'longitude': instance.longitude,
'alamat': instance.alamat,
'foto': instance.foto,
'telp': instance.telp,
};
'nama': instance.nama,
'latitude': instance.latitude,
'longitude': instance.longitude,
'alamat': instance.alamat,
'foto': instance.foto,
'telepon': instance.telepon,
};
......@@ -60,17 +60,15 @@ class CookiesInterface {
await getApplicationDocumentsDirectory().then((Directory directory) {
dir = directory;
});
File cookieFile = File(dir.path + "/searchhistory.json");
File cookieFile = File('${dir.path}/searchhistory.json');
cookieFile.createSync();
await checkCookieFileAvailability(fileName: "searchhistory").then((available) async {
if (available) {
await getCookieFile(fileName: "searchhistory").then((cookie) {
bool test = cookie == null;
print("cookie is null? $test");
if (cookie == null) {
currentSearchHistory = [];
} else {
currentSearchHistory = json.decode(cookie);
currentSearchHistory = cookie == "" ? [] : json.decode(cookie);
}
currentSearchHistory.insert(0, recentSearch);
});
......@@ -92,7 +90,12 @@ class CookiesInterface {
dir = directory;
});
File file = File("${dir.path}/$fileName.json");
dynamic res = file.readAsStringSync();
dynamic res;
try {
res = file.readAsStringSync();
} on Exception {
res = [];
}
return res;
}
}
final mall = [
{
"nama": "Garrison",
"latitude": -29.7127463,
"longitude": -51.2422395,
"alamat": "39 Florence Crossing",
"telepon": "+55 427 384 8575"
},
{
"nama": "Merchant",
"latitude": 59.3528754,
"longitude": 24.0551606,
"alamat": "479 Tennessee Alley",
"telepon": "+372 472 370 4597"
},
{
"nama": "Sachs",
"latitude": 53.7109905,
"longitude": 20.6879247,
"alamat": "238 Hermina Park",
"telepon": "+48 574 907 6433"
},
{
"nama": "Mccormick",
"latitude": -40.1929865,
"longitude": 175.2929384,
"alamat": "70127 Warrior Pass",
"telepon": "+64 280 260 5446"
},
{
"nama": "Columbus",
"latitude": 38.627216,
"longitude": -9.1035863,
"alamat": "502 Carberry Park",
"telepon": "+351 321 303 5722"
},
{
"nama": "Homewood",
"latitude": 55.6849184,
"longitude": 12.5506988,
"alamat": "95032 Stephen Crossing",
"telepon": "+45 542 945 6476"
},
{
"nama": "Fallview",
"latitude": -8.4824984,
"longitude": 118.9586867,
"alamat": "75544 Farragut Center",
"telepon": "+62 436 950 7980"
},
{
"nama": "Sugar",
"latitude": 40.09864,
"longitude": 119.949545,
"alamat": "1251 Logan Hill",
"telepon": "+86 212 470 4195"
},
{
"nama": "Holy Cross",
"latitude": 16.6482598,
"longitude": 101.0118776,
"alamat": "7 Corry Drive",
"telepon": "+66 136 457 5719"
},
{
"nama": "Bashford",
"latitude": 12.3730419,
"longitude": 14.2076222,
"alamat": "92 Rockefeller Road",
"telepon": "+234 119 536 3649"
}
];
final postingan = [
{
"nama_orang": "Barny Folkerd",
"suka": 1,
"tidak_suka": 1,
"diverifikasi": true,
"foto": "http://dummyimage.com/128x141.png/ff4444/ffffff",
"date": "12/22/2019",
"time": "3:57 AM"
},
{
"nama_orang": "Erhart Cicchillo",
"suka": 2,
"tidak_suka": 2,
"diverifikasi": true,
"foto": "http://dummyimage.com/128x141.png/5fa2dd/ffffff",
"date": "1/8/2020",
"time": "6:38 PM"
},
{
"nama_orang": "Jori Biaggioli",
"suka": 3,
"tidak_suka": 3,
"diverifikasi": true,
"foto": "http://dummyimage.com/128x141.png/cc0000/ffffff",
"date": "7/23/2019",
"time": "5:59 AM"
},
{
"nama_orang": "Giacinta Mirando",
"suka": 4,
"tidak_suka": 4,
"diverifikasi": true,
"foto": "http://dummyimage.com/128x141.png/dddddd/000000",
"date": "12/3/2019",
"time": "11:14 PM"
},
{
"nama_orang": "Reece Seals",
"suka": 5,
"tidak_suka": 5,
"diverifikasi": false,
"foto": "http://dummyimage.com/128x141.png/cc0000/ffffff",
"date": "11/6/2019",
"time": "11:27 PM"
},
{
"nama_orang": "Lark McReidy",
"suka": 6,
"tidak_suka": 6,
"diverifikasi": true,
"foto": "http://dummyimage.com/128x141.png/dddddd/000000",
"date": "1/15/2020",
"time": "11:05 AM"
},
{
"nama_orang": "Helli Gentsch",
"suka": 7,
"tidak_suka": 7,
"diverifikasi": false,
"foto": "http://dummyimage.com/128x141.png/cc0000/ffffff",
"date": "1/24/2020",
"time": "9:17 PM"
},
{
"nama_orang": "Beniamino Dadd",
"suka": 8,
"tidak_suka": 8,
"diverifikasi": true,
"foto": "http://dummyimage.com/128x141.png/dddddd/000000",
"date": "1/17/2020",
"time": "12:34 PM"
},
{
"nama_orang": "Mar Outridge",
"suka": 9,
"tidak_suka": 9,
"diverifikasi": false,
"foto": "http://dummyimage.com/128x141.png/5fa2dd/ffffff",
"date": "9/16/2019",
"time": "12:17 AM"
},
{
"nama_orang": "Domenic Pennetta",
"suka": 10,
"tidak_suka": 10,
"diverifikasi": false,
"foto": "http://dummyimage.com/128x141.png/dddddd/000000",
"date": "4/4/2019",
"time": "9:46 PM"
}
];
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/config/styles.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;
Komentar(
{@required this.user,
@required this.like,
@required this.dislike,
@required this.urlImage,
@required this.komentar,
@required this.tags});
@override
_KomentarState createState() => _KomentarState();
}
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',
),
),
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],
),
),
],
)),
Icon(Icons.thumb_down, color: redPrimary, size: 20),
Text(
'${widget.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',
),
),
),
],
),
Row(
children: <Widget>[
...widget.tags.map<Widget>((tag) {
return _tag(tag);
}).toList()
],
),
],
));
}
Widget _tag(String tag) {
return Container(
margin: EdgeInsets.only(top: regularSpace, right: regularSpace),
padding: EdgeInsets.all(6),
decoration: BoxDecoration(
boxShadow: smallShadow,
border: Border.all(width: 2, color: greenPrimary.withOpacity(0.4)),
borderRadius: BorderRadius.all(
Radius.circular(10) // <--- border radius here
),