mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 15:48:41 +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 setupPushNotification();
|
||||||
await initMediaStorage();
|
await initMediaStorage();
|
||||||
await initFCMService();
|
initFCMService();
|
||||||
|
|
||||||
gCameras = await availableCameras();
|
gCameras = await availableCameras();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -152,10 +152,12 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||||
const InputDecorationTheme(border: OutlineInputBorder())),
|
const InputDecorationTheme(border: OutlineInputBorder())),
|
||||||
darkTheme: ThemeData.dark().copyWith(
|
darkTheme: ThemeData.dark().copyWith(
|
||||||
colorScheme: ColorScheme.fromSeed(
|
colorScheme: ColorScheme.fromSeed(
|
||||||
brightness: Brightness.dark, // <-- the only line added
|
brightness: Brightness.dark, // <-- the only line added
|
||||||
seedColor: const Color(0xFF57CC99)),
|
seedColor: const Color(0xFF57CC99),
|
||||||
inputDecorationTheme:
|
),
|
||||||
const InputDecorationTheme(border: OutlineInputBorder()),
|
inputDecorationTheme: const InputDecorationTheme(
|
||||||
|
border: OutlineInputBorder(),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
themeMode: context.watch<SettingsChangeProvider>().themeMode,
|
themeMode: context.watch<SettingsChangeProvider>().themeMode,
|
||||||
initialRoute: '/',
|
initialRoute: '/',
|
||||||
|
|
@ -184,9 +186,8 @@ class MyAppMainWidget extends StatefulWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
class _MyAppMainWidgetState extends State<MyAppMainWidget> {
|
class _MyAppMainWidgetState extends State<MyAppMainWidget> {
|
||||||
Future<bool> _isUserCreated =
|
Future<bool> _isUserCreated = isUserCreated();
|
||||||
isUserCreated(); // Assume this is a function that checks if the user is created
|
bool _showOnboarding = true;
|
||||||
bool _showOnboarding = true; // Initial state for onboarding
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
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:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
import 'package:pie_menu/pie_menu.dart';
|
import 'package:pie_menu/pie_menu.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:twonly/src/providers/send_next_media_to.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 'camera_to_share/camera_preview_view.dart';
|
||||||
import 'chats/chat_list_view.dart';
|
import 'chats/chat_list_view.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
@ -34,10 +36,28 @@ class HomeViewState extends State<HomeView> {
|
||||||
activePageIdx = index;
|
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
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
|
selectNotificationStream.close();
|
||||||
// disable globalCallbacks to the flutter tree
|
// disable globalCallbacks to the flutter tree
|
||||||
globalUpdateOfHomeViewPageIndex = (a) {};
|
globalUpdateOfHomeViewPageIndex = (a) {};
|
||||||
super.dispose();
|
super.dispose();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue