Commit 03eaf7ea by Ramesh Babu Puvvadi

initial commit

parent fff8be6c
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
class FirebaseApi {
final _firebasemessaging = FirebaseMessaging.instance;
......@@ -7,13 +8,15 @@ class FirebaseApi {
Future<void> initNotifications() async {
await _firebasemessaging.requestPermission();
final fcmToken = await _firebasemessaging.getToken();
print(fcmToken);
if (kDebugMode) {
print(fcmToken);
}
}
Future<void> handleBackgroundMessage(RemoteMessage message) async {
await Firebase.initializeApp();
print('Title :${message.notification?.title}');
print('Title :${message.notification?.body}');
print('Title :${message.data}');
//print('Title :${message.notification?.title}');
//print('Title :${message.notification?.body}');
//print('Title :${message.data}');
}
}
......@@ -11,8 +11,7 @@ import 'Constants.dart';
class FootFall extends StatefulWidget {
final String message;
final String selecteddate;
const FootFall(
{super.key, required this.message, required this.selecteddate});
const FootFall({super.key, required this.message, required this.selecteddate});
@override
_FootFall createState() => _FootFall();
......
......@@ -13,8 +13,8 @@ class NotificationReport extends StatefulWidget {
final String message;
final String selecteddate;
const NotificationReport(
{super.key, required this.message, required this.selecteddate});
const NotificationReport({super.key, required this.message, required this.selecteddate});
@override
_NotificationReport createState() => _NotificationReport();
}
......@@ -32,14 +32,14 @@ class _NotificationReport extends State<NotificationReport> {
@override
void initState() {
super.initState();
// _selectedDate1 = DateTime.now();
// _dateTime1.text = DateFormat('yyyy/MM/dd').format(_selectedDate1);
String dateString = widget.selecteddate;
DateFormat format = DateFormat("yyyy/MM/dd");
_selectedDate1 = format.parse(dateString);
_dateTime1.text = DateFormat('yyyy/MM/dd').format(_selectedDate1);
isMeeters = widget.message;
loadData();
if (widget.selecteddate != '') {
String dateString = widget.selecteddate;
DateFormat format = DateFormat("yyyy/MM/dd");
_selectedDate1 = format.parse(dateString);
_dateTime1.text = DateFormat('yyyy/MM/dd').format(_selectedDate1);
isMeeters = widget.message;
loadData();
}
}
Future<void> loadData() async {
......
......@@ -19,10 +19,11 @@ class UserPreferences {
}
class SplashScreen extends StatefulWidget {
const SplashScreen({Key? key}) : super(key: key);
const SplashScreen({Key? key}) : super(key: key);
@override
_SplashScreenState createState() => _SplashScreenState();
}
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