navihate to notificatons when after click on push notification
This commit is contained in:
@@ -6,7 +6,8 @@ import 'package:tm_app/core/utils/size_config.dart';
|
||||
import 'package:tm_app/view_models/auth_view_model.dart';
|
||||
|
||||
class MobileSplashPage extends StatefulWidget {
|
||||
const MobileSplashPage({super.key});
|
||||
const MobileSplashPage({required this.navigateToNotification, super.key});
|
||||
final bool navigateToNotification;
|
||||
|
||||
@override
|
||||
State<MobileSplashPage> createState() => _MobileSplashPageState();
|
||||
@@ -27,7 +28,14 @@ class _MobileSplashPageState extends State<MobileSplashPage> {
|
||||
void _viewModelListener() {
|
||||
if (viewModel.isLoggedIn) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
Router.neglect(context, () => const HomeRouteData().go(context));
|
||||
if (widget.navigateToNotification) {
|
||||
Router.neglect(
|
||||
context,
|
||||
() => const NotificationRouteData().go(context),
|
||||
);
|
||||
} else {
|
||||
Router.neglect(context, () => const HomeRouteData().go(context));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
|
||||
Reference in New Issue
Block a user