Fakultas Ilmu Komputer UI

Commit a75d4be5 authored by Dzaky Noor Hasyim's avatar Dzaky Noor Hasyim
Browse files

[GREEN] Passed test, adding kegiatan_terdekat_repository

parent c8a10fa9
import 'package:bisaGo/repository/kegiatan_repository.dart';
import 'package:bisaGo/repository/kegiatan_terdekat_repository.dart';
import 'package:bisaGo/repository/komentar_posting_kegiatan_repository.dart';
import 'package:bisaGo/repository/komentar_posting_repository.dart';
import 'package:bisaGo/repository/komentar_repository.dart';
......@@ -30,5 +31,7 @@ class AppGetIt {
() => LayananRepository());
_getIt.registerLazySingleton<BaseKegiatanRepository>(
() => KegiatanRepository());
_getIt.registerLazySingleton<BaseKegiatanTerdekatRepository>(
() => KegiatanTerdekatRepository());
}
}
import 'package:bisaGo/network/network_interface.dart';
import 'package:bisaGo/model/kegiatan.dart';
abstract class BaseKegiatanTerdekatRepository {
Future fetchKegiatanTerdekatResponse();
}
class KegiatanTerdekatRepository implements BaseKegiatanTerdekatRepository {
final NetworkInterface _network = NetworkInterface();
@override
Future fetchKegiatanTerdekatResponse() async {
final response = await _network.get(
url: '/informasi-fasilitas/lokasi/kegiatan-terdekat',isLogin: false);
var kegiatan = KegiatanModel.fromJson(response);
return kegiatan;
}
}
\ No newline at end of file
......@@ -79,6 +79,6 @@ void main() {
));
await tester.pump();
expect(find.byType(Dashboard), findsOneWidget);
expect(find.text('Kopdar Rutin Test'), findsOneWidget);
expect(find.text('Kopdar Rutin'), findsOneWidget);
});
}
\ No newline at end of file
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