Fakultas Ilmu Komputer UI

Commit 0afb43bf authored by Fakhira Devina's avatar Fakhira Devina
Browse files

Merge branch 'PBI-2-pencarian_lokasi' into PBI-5-daftar_layanan_fasilitas_publik

parents 3be07ef0 2acfb83d
Pipeline #38662 failed with stages
in 14 minutes and 55 seconds
<<<<<<< HEAD
{"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-03-28 21:53:45.371259","version":"1.15.17"}
=======
{"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":[]}],"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":[]}],"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":[]}],"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":[]}],"date_created":"2020-04-06 23:54:02.345091","version":"1.15.17"}
>>>>>>> dev-agnes
{"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 00:47:59.249495","version":"1.15.17"}
\ No newline at end of file
......@@ -60,17 +60,17 @@ 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");
print("$cookie");
if (cookie == null) {
currentSearchHistory = [];
} else {
currentSearchHistory = json.decode(cookie);
currentSearchHistory = cookie == "" ? [] : json.decode(cookie);
}
currentSearchHistory.insert(0, recentSearch);
});
......@@ -92,7 +92,14 @@ class CookiesInterface {
dir = directory;
});
File file = File("${dir.path}/$fileName.json");
dynamic res = file.readAsStringSync();
dynamic res;
try {
print('woyyy');
res = file.readAsStringSync();
print(res == "");
} on Exception catch(e) {
res = [];
}
return res;
}
}
......@@ -5,6 +5,7 @@ import 'package:ppl_disabilitas/component/bisago_appbar.dart';
import 'package:ppl_disabilitas/component/bisago_drawer.dart';
import 'package:ppl_disabilitas/config/styles.dart';
import 'package:ppl_disabilitas/network/data/network_model.dart';
import 'package:ppl_disabilitas/page/filter_fasilitas/insideFilter.dart';
import 'package:ppl_disabilitas/page/filter_fasilitas/komentar.dart';
class Fasilitas extends StatefulWidget {
......@@ -140,9 +141,11 @@ class _FasilitasState extends State<Fasilitas> {
borderRadius: regularBorderRadius,
side: BorderSide(color: Colors.transparent)),
splashColor: Colors.lightGreen,
onPressed: () {
/*...*/
},
onPressed: () => showModalBottomSheet(
context: context,
builder: (context) => InsideFilter(),
backgroundColor: Colors.transparent,
isScrollControlled: true),
child: Row(
children: <Widget>[
Icon(Icons.filter_list,
......@@ -175,18 +178,22 @@ class _FasilitasState extends State<Fasilitas> {
case Status.COMPLETED:
final komentar = snapshot.data.data;
return ListView.builder(
shrinkWrap: true,
shrinkWrap: true,
itemCount: komentar.allKomentar.length,
itemBuilder: (BuildContext context, int index) {
return Komentar(
dislike: komentar.allKomentar[index].tidak_suka,
komentar: 'Lorem ipsum',
like: komentar.allKomentar[index].suka,
tags: ['#toiletdisabilitas', '#kursiroda'],
urlImage: [komentar.allKomentar[index].foto],
user: komentar.allKomentar[index].nama_orang,
);
});
dislike:
komentar.allKomentar[index].tidak_suka,
komentar: 'Lorem ipsum',
like: komentar.allKomentar[index].suka,
tags: ['#toiletdisabilitas', '#kursiroda'],
urlImage: [
komentar.allKomentar[index].foto
],
user:
komentar.allKomentar[index].nama_orang,
);
});
break;
case Status.ERROR:
return Center(
......
This diff is collapsed.
......@@ -202,11 +202,17 @@ class PencarianState extends State<Pencarian> {
shrinkWrap: true,
itemCount: places.length,
itemBuilder: (context, index) {
print('${places.listLokasi[index].telepon == null}');
return InkWell(
key: Key("$key-${places[index].nama}"),
onTap: () {
_bloc.saveRecentSearch(places[index]);
Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => Fasilitas(
alamat: places[index].alamat,
nama: places[index].nama,
telpon: places[index].telepon,
url: 'http://dummyimage.com/128x141.png/ff4444/ffffff',
)));
},
child: Container(
decoration: BoxDecoration(
......
......@@ -6,7 +6,7 @@ import 'package:ppl_disabilitas/network/network_interface.dart';
class LokasiRepository {
NetworkInterface _network = NetworkInterface();
CookiesInterface _cookie = CookiesInterface();
Future<LokasiListResponse> fetchLokasi() async {
final response = await _network.get(
url: 'https://my.api.mockaroo.com/mall.json?key=dbcde960',
......@@ -17,17 +17,19 @@ class LokasiRepository {
Future<LokasiListResponse> fetchRecentSearch() async {
var response;
await CookiesInterface()
await _cookie
.checkCookieFileAvailability(fileName: "searchhistory")
.then((boolean) async {
if (!boolean) {
response = [];
} else {
await CookiesInterface()
.getCookieFile(fileName: "searchhistory")
.then((cookie) {
response = json.decode(cookie);
});
try {
await _cookie.getCookieFile(fileName: "searchhistory").then((cookie) {
response = json.decode(cookie);
});
} on Exception catch (e) {
response = [];
}
}
});
return LokasiListResponse(
......@@ -36,7 +38,6 @@ class LokasiRepository {
Future<void> saveRecentSearch(Lokasi recentSearch) async {
Map<String, dynamic> searchToMap = recentSearch.toJson();
await CookiesInterface()
.createSearchHistoryCookie(recentSearch: searchToMap);
await _cookie.createSearchHistoryCookie(recentSearch: searchToMap);
}
}
......@@ -37,8 +37,16 @@ void main() {
});
testWidgets('display list view in pencarian', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: Pencarian()));
// [TODO] pencet textfieldnya, isi textfieldnya pake Coolidge
// [TODO] expect nya keluar satu item namanya coolidge, expectnya pake key aja
expect(find.byKey(const Key("Text Field Mau Kemana")), findsOneWidget);
//var textField = find.byKey(const Key("Text Field Mau Kemana"));
//await tester.tap(textField);
await tester.enterText(find.byKey(const Key("Text Field Mau Kemana")), "Coolidge");
await tester.pump();
expect(find.text("Hasil Pencarian"), findsOneWidget);
//expect(find.byType(CircleAvatar), findsWidgets);
//expect(find.byKey(const Key("api-Coolidge")), findsOneWidget);
// [TODO] tiap item itu punya key unik
// Search for the childWidget in the tree and verify it exists.
//expect(find.byType(ListView), findsNWidgets);
......
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