Fakultas Ilmu Komputer UI

Commit 061effe8 authored by Yoga Pratama's avatar Yoga Pratama
Browse files

[CHORES] Delete duplicate line

parent e7f00baf
Pipeline #78258 failed with stages
in 8 minutes and 23 seconds
......@@ -37,8 +37,6 @@ class AppGetIt {
() => KegiatanTerdekatRepository());
_getIt.registerLazySingleton<BaseDynamicLinksServiceRepository>(
() => DynamicLinksServiceRepository());
_getIt.registerLazySingleton<BaseDynamicLinksServiceRepository>(
() => DynamicLinksServiceRepository());
_getIt.registerLazySingleton<BaseCloudMessagingRepository>(
() => CloudMessagingRepository());
}
......
import 'package:bisaGo/bloc/cloud_messaging_bloc.dart';
import 'package:bisaGo/bloc/lokasi_response_bloc.dart';
import 'package:bisaGo/model/komentar.dart';
import 'package:bisaGo/model/lokasi.dart';
......@@ -23,6 +24,7 @@ import 'package:bisaGo/component/bisago_drawer.dart';
import 'package:bisaGo/config/styles.dart';
import 'package:bisaGo/page/pencarian/pencarian.dart';
import 'package:google_maps_webservice/places.dart';
import 'package:shared_preferences/shared_preferences.dart';
class Dashboard extends StatefulWidget {
const Dashboard({Key key}) : super(key: key);
......@@ -39,6 +41,7 @@ class DashboardState extends State<Dashboard> {
LokasiResponseBloc bloc = LokasiResponseBloc();
KegiatanTerdekatBloc blocKegiatanTerdekat = KegiatanTerdekatBloc();
CloudMessagingBloc cloudMessagingBloc = CloudMessagingBloc();
FirebaseMessaging _firebaseMessaging;
......@@ -74,8 +77,13 @@ class DashboardState extends State<Dashboard> {
}
void _requestFCMToken() async {
final token = await _firebaseMessaging.getToken();
print(token);
final fcmToken = await _firebaseMessaging.getToken();
final sharedPreferences = await SharedPreferences.getInstance();
final token = sharedPreferences.getString('token');
if (token != null) {
await cloudMessagingBloc.sendFCMToken(fcmToken, token);
}
}
void _navigateToPencarianPage(BuildContext context) {
......
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