update notificaciones
This commit is contained in:
+1
-1
@@ -86,7 +86,7 @@ class MyApp extends StatelessWidget {
|
||||
theme: ThemeData(fontFamily: 'Poppins'),
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'ProsApp',
|
||||
initialRoute: '/splash',
|
||||
initialRoute: '/',
|
||||
routes: {
|
||||
'/splash': (context) => const SplashScreen(),
|
||||
'/': (context) => const LoginScreen(),
|
||||
|
||||
@@ -71,7 +71,8 @@ class _CitaScreenState extends State<CitaScreen> {
|
||||
'data': <String, dynamic>{
|
||||
'click_action': 'FLUTTER_NOTIFICATION_CLICK',
|
||||
'id': '1',
|
||||
'status': 'done'
|
||||
'status': 'done',
|
||||
'screen': 'misservicios',
|
||||
},
|
||||
'to': user
|
||||
},
|
||||
|
||||
@@ -14,12 +14,14 @@ import 'package:prosappco/src/authentication/authentication_repository.dart';
|
||||
import 'package:prosappco/src/components/drawer_menu.dart';
|
||||
import 'package:prosappco/src/models/event_model.dart';
|
||||
import 'package:prosappco/src/models/user_model.dart';
|
||||
import 'package:prosappco/src/screens/my_services.dart';
|
||||
import 'package:prosappco/src/screens/professional.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:prosappco/src/screens/profile.dart';
|
||||
import 'package:prosappco/src/screens/profile_web.dart';
|
||||
import 'package:prosappco/src/screens/service_after.dart';
|
||||
import 'package:prosappco/src/screens/service_type.dart';
|
||||
import 'package:prosappco/src/screens/solicitudes.dart';
|
||||
import 'package:prosappco/src/screens/ubicacion.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:prosappco/src/components/network_utility.dart';
|
||||
@@ -47,6 +49,26 @@ class _ServiceScreenState extends State<ServiceScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
void _handleBackgroundMessage(RemoteMessage message) async {
|
||||
final Map<String, dynamic> data = message.data;
|
||||
|
||||
if (data['click_action'] == 'FLUTTER_NOTIFICATION_CLICK') {
|
||||
final String screen = data['screen'];
|
||||
|
||||
if (screen == 'solicitud') {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => SolicitudScreen()),
|
||||
);
|
||||
} else if (screen == 'misservicios') {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => MyServicesScreen()),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> sendPushNotification(String pro) async {
|
||||
try {
|
||||
http.Response response = await http.post(
|
||||
|
||||
Reference in New Issue
Block a user