Fakultas Ilmu Komputer UI

Commit 8df32916 authored by Putri Salsabila's avatar Putri Salsabila
Browse files

[CHORES] Fixing conflicts

parents 4c84cb30 190369a8
Pipeline #81726 passed with stages
in 14 minutes and 59 seconds
......@@ -83,7 +83,9 @@ dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-analytics:17.2.2'
implementation 'com.google.firebase:firebase-analytics:'
implementation 'com.google.firebase:firebase-messaging:'
implementation 'com.google.firebase:firebase-bom:27.0.0'
}
apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
......@@ -39,6 +39,10 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
......@@ -47,5 +51,13 @@
android:value="2" />
<meta-data android:name="com.google.android.geo.API_KEY"
android:value="${MAPS_API_KEY}"/>
<!-- Set custom default icon. This is used when no icon is set for incoming notification messages. -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/transparent_icon" />
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming notification message. -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="@color/color_accent" />
</application>
</manifest>
<resources>
<color name="splash_color">#3A903A</color>
<color name="color_accent">#3A903A</color>
</resources>
3.5.0:
- Pengguna dapat mengganti foto profil
3.4.0:
- Notifikasi pengguna untuk komentar baru
3.3.0:
- New feature for add kegiatan
- Fix bugs
- Kegiatan disabilitas di suatu lokasi
- Perbaikan bugs
3.2.1:
- Fix cant update fasilitas
- Perbaikan masalah update fasilitas
3.2.0:
- New feature share fasilitas as a link
- Tersedia fitur membagikan informasi fasilitas/kegiatan disabilitas kepada orang lain
3.1.2:
- Fix google oauth
- Perbaikan masuk dengan Google
3.1.1:
- Add dialog to turn on Location services upon starting the app
- New feature for layanan search
- Add feature to upload image for a fasilitas straight from the camera
- Add default image for facilities
- Add search history feature
- Now all fields are required in edit profile
- Tersedia fitur pencarian layanan
- Tersedia pilihan kamera ketika menambahkan gambar fasilitas
- Tersedia fitur riwayat pencarian
import 'package:bisaGo/repository/cloud_messaging_repository.dart';
import 'package:get_it/get_it.dart';
import 'package:http/http.dart';
class CloudMessagingBloc {
CloudMessagingRepository _cloudMessagingRepository;
CloudMessagingBloc() {
_cloudMessagingRepository =
GetIt.instance.get<BaseCloudMessagingRepository>();
}
Future<dynamic> sendFCMToken(
String fcmToken,
String token,
) async {
try {
return await _cloudMessagingRepository.sendFCMToken(
fcmToken,
token,
);
} catch (e) {
return Response('Failed to add komentar', 400);
}
}
}
import 'dart:async';
import 'package:bisaGo/model/new_user.dart';
import 'package:bisaGo/network/data/network_model.dart';
import 'package:bisaGo/repository/user_repository.dart';
import 'package:get_it/get_it.dart';
import 'package:http/http.dart';
class NewUserBloc {
UserRepository _userRepository;
StreamController _userController;
NewUserBloc() {
_userController = StreamController<NetworkModel<String>>();
_userRepository = GetIt.instance.get<BaseUserRepository>();
}
Future<Response> registerNewUser(NewUser newUser) async {
try {
return await _userRepository.createUser(newUser);
} catch (_) {
return Response('Failed to register user', 400);
}
}
Future<Response> updateUser(NewUser newUser) async {
try {
return await _userRepository.updateUser(newUser);
} catch (_) {
return Response('Failed to update user', 400);
}
}
void dispose() {
_userController?.close();
}
}
......@@ -8,39 +8,54 @@ import 'package:get_it/get_it.dart';
class UserBloc {
UserRepository _userRepository;
StreamController _userController;
List<UserModel> userFromApi;
String email;
StreamSink<NetworkModel<User>> get userSink => _userController.sink;
Stream<NetworkModel<User>> get userStream => _userController.stream;
StreamSink<NetworkModel<DetailUserModel>> get userSink =>
_userController.sink;
UserBloc(String email) {
_userController = StreamController<NetworkModel<User>>();
Stream<NetworkModel<DetailUserModel>> get userStream =>
_userController.stream;
UserBloc({this.email}) {
_userController = StreamController<NetworkModel<DetailUserModel>>();
_userRepository = GetIt.instance.get<BaseUserRepository>();
fetchUserDetail(email);
}
Future<void> fetchUserDetail(String email) async {
Future<void> fetchUserDetail() async {
userSink.add(NetworkModel.loading('Getting user'));
final response = await getUserDetail(email);
if (response is DetailUserModel) {
userSink.add(NetworkModel.completed(response));
} else {
userSink.add(NetworkModel.error('Gagal untuk mendapatkan profile'));
}
}
Future<dynamic> getUserDetail(String email) async {
try {
final userResponse = await _userRepository.fetchUserDetail(email);
userFromApi = List.from(userResponse.user);
userSink.add(NetworkModel.completed(userResponse));
return await _userRepository.fetchUserDetail(email);
} catch (e) {
if (!_userController.isClosed) {
userSink.add(NetworkModel.error(e.toString()));
}
return e;
}
}
Future<UserModel> fetchUser(String email) async {
Future<DetailUserModel> updateUser(UpdateUserModel updateUser) async {
try {
await fetchUserDetail(email);
return userFromApi.first;
} catch (e) {
return await _userRepository.updateUser(updateUser, email);
} catch (_) {
return null;
}
}
Future<bool> registerNewUser(RegisterUserModel registerUserModel) async {
try {
await _userRepository.registerUser(registerUserModel);
return true;
} catch (_) {
return false;
}
}
void dispose() {
_userController?.close();
}
......
......@@ -5,17 +5,24 @@ class BisaGoAppBar extends StatelessWidget implements PreferredSizeWidget {
final String title;
final List<Widget> actions;
final Widget leading;
final backgroundColor;
const BisaGoAppBar(
{this.title = 'bisaGo', this.actions = const [], this.leading, Key key})
{this.title = 'bisaGo',
this.actions = const [],
this.backgroundColor = greenPrimary,
this.leading,
Key key})
: super(key: key);
@override
final Size preferredSize = const Size.fromHeight(55);
@override
Widget build(BuildContext context) {
return AppBar(
elevation: 15,
centerTitle: true,
backgroundColor: greenPrimary,
backgroundColor: backgroundColor,
automaticallyImplyLeading: leading == null,
leading: leading,
title: Row(
......
import 'dart:convert';
import 'package:bisaGo/page/informasi/list_sekolah.dart';
import 'package:bisaGo/page/profile/profile.dart';
import 'package:bisaGo/page/tentang_disabilitas/tentang_disabilitas.dart';
......@@ -65,7 +67,7 @@ class BisaGoDrawer extends StatelessWidget {
),
Container(
decoration:
BoxDecoration(border: Border(top: BorderSide(color: Colors.white))),
BoxDecoration(border: Border(top: BorderSide(color: Colors.white))),
),
];
menus.forEach((element) => drawerItem.add(element));
......@@ -168,7 +170,8 @@ class BisaGoDrawer extends StatelessWidget {
if (sharedPreferences.getString('token') == null) {
return 'Selamat datang ke BisaGo!';
} else {
return sharedPreferences.getString('email');
final userJson = jsonDecode(sharedPreferences.getString('user'));
return userJson['email'];
}
}
......
import 'package:bisaGo/repository/cloud_messaging_repository.dart';
import 'package:bisaGo/repository/kegiatan_repository.dart';
import 'package:bisaGo/repository/kegiatan_terdekat_repository.dart';
import 'package:bisaGo/repository/komentar_posting_kegiatan_repository.dart';
......@@ -26,8 +27,8 @@ class AppGetIt {
() => KomentarPostingRepository());
_getIt.registerLazySingleton<BaseKomentarPostingKegiatanRepository>(
() => KomentarPostingKegiatanRepository());
_getIt.registerLazySingleton<BaseLokasiRepository>(
() => LokasiRepository());
_getIt
.registerLazySingleton<BaseLokasiRepository>(() => LokasiRepository());
_getIt.registerLazySingleton<BaseLayananRepository>(
() => LayananRepository());
_getIt.registerLazySingleton<BaseKegiatanRepository>(
......@@ -36,5 +37,7 @@ class AppGetIt {
() => KegiatanTerdekatRepository());
_getIt.registerLazySingleton<BaseDynamicLinksServiceRepository>(
() => DynamicLinksServiceRepository());
_getIt.registerLazySingleton<BaseCloudMessagingRepository>(
() => CloudMessagingRepository());
}
}
import 'package:bisaGo/get_it.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:bisaGo/app.dart';
import 'package:intl/date_symbol_data_local.dart';
......@@ -6,14 +7,24 @@ import 'package:intl/intl.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'flavor/flavor.dart';
import 'globalnetwork.dart';
import 'package:bisaGo/get_it.dart';
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
// If you're going to use other Firebase services in the background, such as Firestore,
// make sure you call `initializeApp` before using other Firebase services.
await Firebase.initializeApp();
print('Handling a background message: ${message.messageId}');
}
Future main() async {
AppGetIt().initialize();
await DotEnv().load('.env');
getDioInstance('build');
await initializeDateFormatting('id_ID', null);
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
Intl.defaultLocale = 'id_ID';
dio.options.receiveTimeout = 15000;
ApiFlavor.flavor = BuildFlavor.production.toString();
ApiFlavor.flavor = BuildFlavor.development.toString();
runApp(BisaGo());
}
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:bisaGo/app.dart';
import 'package:intl/date_symbol_data_local.dart';
......@@ -7,11 +9,20 @@ import 'flavor/flavor.dart';
import 'globalnetwork.dart';
import 'package:bisaGo/get_it.dart';
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
// If you're going to use other Firebase services in the background, such as Firestore,
// make sure you call `initializeApp` before using other Firebase services.
await Firebase.initializeApp();
print('Handling a background message: ${message.messageId}');
}
Future main() async {
AppGetIt().initialize();
await DotEnv().load('.env');
getDioInstance('build');
await initializeDateFormatting('id_ID', null);
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
Intl.defaultLocale = 'id_ID';
dio.options.receiveTimeout = 15000;
ApiFlavor.flavor = BuildFlavor.development.toString();
......
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/material.dart';
import 'package:bisaGo/app.dart';
import 'package:intl/date_symbol_data_local.dart';
......@@ -7,13 +9,22 @@ import 'flavor/flavor.dart';
import 'globalnetwork.dart';
import 'package:bisaGo/get_it.dart';
Future<void> _firebaseMessagingBackgroundHandler(RemoteMessage message) async {
// If you're going to use other Firebase services in the background, such as Firestore,
// make sure you call `initializeApp` before using other Firebase services.
await Firebase.initializeApp();
print('Handling a background message: ${message.messageId}');
}
Future main() async {
AppGetIt().initialize();
await DotEnv().load('.env');
getDioInstance('build');
await initializeDateFormatting('id_ID', null);
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
Intl.defaultLocale = 'id_ID';
dio.options.receiveTimeout = 15000;
ApiFlavor.flavor = BuildFlavor.staging.toString();
ApiFlavor.flavor = BuildFlavor.development.toString();
runApp(BisaGo());
}
\ No newline at end of file
}
......@@ -17,6 +17,8 @@ class KegiatanModel {
String creator;
@JsonKey(name: 'nama_kegiatan')
String namaKegiatan;
@JsonKey(name: 'creator_email')
String creatorEmail;
String penyelenggara;
String deskripsi;
@JsonKey(name: 'nama_kontak')
......@@ -38,6 +40,7 @@ class KegiatanModel {
this.placeId,
this.creator,
this.namaKegiatan,
this.creatorEmail,
this.penyelenggara,
this.deskripsi,
this.namaKontak,
......@@ -50,6 +53,7 @@ class KegiatanModel {
}
);
factory KegiatanModel.fromJson(Map<String, dynamic> json) => _$KegiatanModelFromJson(json);
factory KegiatanModel.fromJson(Map<String, dynamic> json) =>
_$KegiatanModelFromJson(json);
Map<String, dynamic> toJson() => _$KegiatanModelToJson(this);
}
......@@ -27,6 +27,7 @@ KegiatanModel _$KegiatanModelFromJson(Map<String, dynamic> json) {
placeId: json['place_id'] as String,
creator: json['creator'] as String,
namaKegiatan: json['nama_kegiatan'] as String,
creatorEmail: json['creator_email'] as String,
penyelenggara: json['penyelenggara'] as String,
deskripsi: json['deskripsi'] as String,
namaKontak: json['nama_kontak'] as String,
......@@ -45,6 +46,7 @@ Map<String, dynamic> _$KegiatanModelToJson(KegiatanModel instance) =>
'place_id': instance.placeId,
'creator': instance.creator,
'nama_kegiatan': instance.namaKegiatan,
'creator_email': instance.creatorEmail,
'penyelenggara': instance.penyelenggara,
'deskripsi': instance.deskripsi,
'nama_kontak': instance.namaKontak,
......
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