Commit 03eaf7ea by Ramesh Babu Puvvadi

initial commit

parent fff8be6c
import 'package:firebase_core/firebase_core.dart'; import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
class FirebaseApi { class FirebaseApi {
final _firebasemessaging = FirebaseMessaging.instance; final _firebasemessaging = FirebaseMessaging.instance;
...@@ -7,13 +8,15 @@ class FirebaseApi { ...@@ -7,13 +8,15 @@ class FirebaseApi {
Future<void> initNotifications() async { Future<void> initNotifications() async {
await _firebasemessaging.requestPermission(); await _firebasemessaging.requestPermission();
final fcmToken = await _firebasemessaging.getToken(); final fcmToken = await _firebasemessaging.getToken();
if (kDebugMode) {
print(fcmToken); print(fcmToken);
} }
}
Future<void> handleBackgroundMessage(RemoteMessage message) async { Future<void> handleBackgroundMessage(RemoteMessage message) async {
await Firebase.initializeApp(); await Firebase.initializeApp();
print('Title :${message.notification?.title}'); //print('Title :${message.notification?.title}');
print('Title :${message.notification?.body}'); //print('Title :${message.notification?.body}');
print('Title :${message.data}'); //print('Title :${message.data}');
} }
} }
...@@ -11,8 +11,7 @@ import 'Constants.dart'; ...@@ -11,8 +11,7 @@ import 'Constants.dart';
class FootFall extends StatefulWidget { class FootFall extends StatefulWidget {
final String message; final String message;
final String selecteddate; final String selecteddate;
const FootFall( const FootFall({super.key, required this.message, required this.selecteddate});
{super.key, required this.message, required this.selecteddate});
@override @override
_FootFall createState() => _FootFall(); _FootFall createState() => _FootFall();
......
...@@ -13,8 +13,8 @@ class NotificationReport extends StatefulWidget { ...@@ -13,8 +13,8 @@ class NotificationReport extends StatefulWidget {
final String message; final String message;
final String selecteddate; final String selecteddate;
const NotificationReport( const NotificationReport({super.key, required this.message, required this.selecteddate});
{super.key, required this.message, required this.selecteddate});
@override @override
_NotificationReport createState() => _NotificationReport(); _NotificationReport createState() => _NotificationReport();
} }
...@@ -32,8 +32,7 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -32,8 +32,7 @@ class _NotificationReport extends State<NotificationReport> {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
// _selectedDate1 = DateTime.now(); if (widget.selecteddate != '') {
// _dateTime1.text = DateFormat('yyyy/MM/dd').format(_selectedDate1);
String dateString = widget.selecteddate; String dateString = widget.selecteddate;
DateFormat format = DateFormat("yyyy/MM/dd"); DateFormat format = DateFormat("yyyy/MM/dd");
_selectedDate1 = format.parse(dateString); _selectedDate1 = format.parse(dateString);
...@@ -41,6 +40,7 @@ class _NotificationReport extends State<NotificationReport> { ...@@ -41,6 +40,7 @@ class _NotificationReport extends State<NotificationReport> {
isMeeters = widget.message; isMeeters = widget.message;
loadData(); loadData();
} }
}
Future<void> loadData() async { Future<void> loadData() async {
SharedPreferences prefs = await SharedPreferences.getInstance(); SharedPreferences prefs = await SharedPreferences.getInstance();
......
...@@ -23,6 +23,7 @@ class SplashScreen extends StatefulWidget { ...@@ -23,6 +23,7 @@ class SplashScreen extends StatefulWidget {
@override @override
_SplashScreenState createState() => _SplashScreenState(); _SplashScreenState createState() => _SplashScreenState();
} }
class _SplashScreenState extends State<SplashScreen> { class _SplashScreenState extends State<SplashScreen> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment