|
|
|
|
@ -1,8 +1,11 @@
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
|
import 'package:test_sa/controllers/notification/firebase_notification_manger.dart';
|
|
|
|
|
import 'package:test_sa/controllers/notification/notification_manger.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/api/user_provider.dart';
|
|
|
|
|
import 'package:test_sa/controllers/providers/settings/app_settings.dart';
|
|
|
|
|
import 'package:test_sa/dashboard_latest/dashboard_view.dart';
|
|
|
|
|
@ -42,7 +45,7 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
bool showAppbar = true;
|
|
|
|
|
late List<Widget> _pages;
|
|
|
|
|
UserProvider? _userProvider;
|
|
|
|
|
|
|
|
|
|
bool isFCM = true;
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
_pages = <Widget>[];
|
|
|
|
|
@ -123,7 +126,14 @@ class _LandPageState extends State<LandPage> {
|
|
|
|
|
// if (_userProvider!.user!.type != UsersTypes.engineer) const CalendarPage(),
|
|
|
|
|
const MyAssetsPage(fromBottomBar: true),
|
|
|
|
|
];
|
|
|
|
|
if (isFCM) {
|
|
|
|
|
FirebaseNotificationManger.initialized(context);
|
|
|
|
|
NotificationManger.initialisation((notificationDetails) {
|
|
|
|
|
FirebaseNotificationManger.handleMessage(context, json.decode(notificationDetails.payload!));
|
|
|
|
|
}, (id, title, body, payload) async {});
|
|
|
|
|
|
|
|
|
|
isFCM = false;
|
|
|
|
|
}
|
|
|
|
|
checkLocalAuth();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|