mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 09:08:40 +00:00
fix #49
This commit is contained in:
parent
67379566a5
commit
d9741ee877
3 changed files with 29 additions and 8 deletions
|
|
@ -36,7 +36,7 @@ void main() async {
|
|||
|
||||
await setupPushNotification();
|
||||
await initMediaStorage();
|
||||
await initFCMService();
|
||||
initFCMService();
|
||||
|
||||
gCameras = await availableCameras();
|
||||
|
||||
|
|
|
|||
|
|
@ -152,10 +152,12 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
|||
const InputDecorationTheme(border: OutlineInputBorder())),
|
||||
darkTheme: ThemeData.dark().copyWith(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
brightness: Brightness.dark, // <-- the only line added
|
||||
seedColor: const Color(0xFF57CC99)),
|
||||
inputDecorationTheme:
|
||||
const InputDecorationTheme(border: OutlineInputBorder()),
|
||||
brightness: Brightness.dark, // <-- the only line added
|
||||
seedColor: const Color(0xFF57CC99),
|
||||
),
|
||||
inputDecorationTheme: const InputDecorationTheme(
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
),
|
||||
themeMode: context.watch<SettingsChangeProvider>().themeMode,
|
||||
initialRoute: '/',
|
||||
|
|
@ -184,9 +186,8 @@ class MyAppMainWidget extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _MyAppMainWidgetState extends State<MyAppMainWidget> {
|
||||
Future<bool> _isUserCreated =
|
||||
isUserCreated(); // Assume this is a function that checks if the user is created
|
||||
bool _showOnboarding = true; // Initial state for onboarding
|
||||
Future<bool> _isUserCreated = isUserCreated();
|
||||
bool _showOnboarding = true;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:pie_menu/pie_menu.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:twonly/src/providers/send_next_media_to.dart';
|
||||
import 'package:twonly/src/services/notification_service.dart';
|
||||
import 'camera_to_share/camera_preview_view.dart';
|
||||
import 'chats/chat_list_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -34,10 +36,28 @@ class HomeViewState extends State<HomeView> {
|
|||
activePageIdx = index;
|
||||
});
|
||||
};
|
||||
|
||||
selectNotificationStream.stream
|
||||
.listen((NotificationResponse? response) async {
|
||||
globalUpdateOfHomeViewPageIndex(1);
|
||||
});
|
||||
initAsync();
|
||||
}
|
||||
|
||||
Future initAsync() async {
|
||||
var notificationAppLaunchDetails =
|
||||
await flutterLocalNotificationsPlugin.getNotificationAppLaunchDetails();
|
||||
|
||||
if (notificationAppLaunchDetails != null) {
|
||||
if (notificationAppLaunchDetails.didNotificationLaunchApp) {
|
||||
globalUpdateOfHomeViewPageIndex(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
selectNotificationStream.close();
|
||||
// disable globalCallbacks to the flutter tree
|
||||
globalUpdateOfHomeViewPageIndex = (a) {};
|
||||
super.dispose();
|
||||
|
|
|
|||
Loading…
Reference in a new issue