Added functionality to jump to talk-tab when app is launched via notification
This commit is contained in:
parent
248483be4e
commit
6d48d299b5
@ -2,4 +2,9 @@ class ApiError {
|
||||
String message;
|
||||
|
||||
ApiError(this.message);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return "ApiError: $message";
|
||||
}
|
||||
}
|
@ -23,12 +23,13 @@ import 'view/pages/timetable/timetable.dart';
|
||||
class App extends StatefulWidget {
|
||||
const App({Key? key}) : super(key: key);
|
||||
|
||||
static PersistentTabController bottomNavigator = PersistentTabController(initialIndex: 0);
|
||||
|
||||
@override
|
||||
State<App> createState() => _AppState();
|
||||
}
|
||||
|
||||
class _AppState extends State<App> {
|
||||
int currentPage = 0;
|
||||
late Timer refetchChats;
|
||||
late Timer updateTimings;
|
||||
|
||||
@ -68,11 +69,9 @@ class _AppState extends State<App> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
PersistentTabController tabController = PersistentTabController(initialIndex: 0);
|
||||
|
||||
return PersistentTabView(
|
||||
context,
|
||||
controller: tabController,
|
||||
controller: App.bottomNavigator,
|
||||
navBarStyle: NavBarStyle.style6,
|
||||
hideNavigationBarWhenKeyboardShows: true,
|
||||
navBarHeight: MediaQuery.of(context).viewInsets.bottom > 0 ? 0.0 : kBottomNavigationBarHeight,
|
||||
|
@ -44,6 +44,7 @@ class NotificationController {
|
||||
}
|
||||
|
||||
static Future<void> onAppOpenedByNotification(RemoteMessage message, BuildContext context) async {
|
||||
NotificationTasks.navigateToTalk();
|
||||
NotificationTasks.updateProviders(context);
|
||||
|
||||
DebugTile(context).run(() {
|
||||
|
@ -1,6 +1,7 @@
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_app_badger/flutter_app_badger.dart';
|
||||
import 'package:marianum_mobile/app.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../model/chatList/chatListProps.dart';
|
||||
@ -17,6 +18,6 @@ class NotificationTasks {
|
||||
}
|
||||
|
||||
static void navigateToTalk() {
|
||||
// TODO Navigate
|
||||
App.bottomNavigator.jumpToTab(1);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user