Merge pull request 'navihate to notificatons when after click on push notification' (#158) from notification_on_click into main
Reviewed-on: https://repo.ravanertebat.com/TM/tm_app/pulls/158
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((_) {
|
||||
|
||||
@@ -6,15 +6,16 @@ import 'package:tm_app/views/splash/pages/m_splash_page.dart';
|
||||
import 'package:tm_app/views/splash/pages/t_splash_page.dart';
|
||||
|
||||
class SplashScreen extends StatelessWidget {
|
||||
const SplashScreen({super.key});
|
||||
const SplashScreen({required this.navigateToNotification, super.key});
|
||||
final bool navigateToNotification;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
SizeConfig.init(context);
|
||||
return const ResponsiveBuilder(
|
||||
mobile: MobileSplashPage(),
|
||||
tablet: TabletSplashPage(),
|
||||
desktop: DesktopSplashPage(),
|
||||
return ResponsiveBuilder(
|
||||
mobile: MobileSplashPage(navigateToNotification: navigateToNotification),
|
||||
tablet: const TabletSplashPage(),
|
||||
desktop: const DesktopSplashPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user