custom_firebase_services 0.0.3 copy "custom_firebase_services: ^0.0.3" to clipboard
custom_firebase_services: ^0.0.3 copied to clipboard

A Flutter package for Firebase services including authentication, notifications, media uploads, and chat features. Simplifies common Firebase operations with clean, reusable APIs.

example/lib/main.dart

import 'package:custom_firebase_services/custom_firebase_services.dart';
import 'package:example/home_screen.dart';
import 'package:example/second_page.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';

final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>();


void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  WidgetsFlutterBinding.ensureInitialized();
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
   MyApp({super.key});

  final MediaUploadService storageService = MediaUploadService();


  // final ChatService chatService = ChatService();

  @override
  Widget build(BuildContext context) {


    final config=  FirebaseNotificationConfig(
        projectId: '---ADD PROJECT ID---',
        senderId: '---ADD SENDER ID---',
        serviceAccountJson: {
          /// add service account here
        },
        onNotificationTap: (payLoad){
          print('payLoad is $payLoad');
          if(payLoad['screen']=='second'){
            print('payLoad iss second');
            navigatorKey.currentState?.push(
              MaterialPageRoute(builder: (_) => SecondPage()),
            );          }else{
            print('payLoad is not  second');
          }
        }
    );
    print('Firebase config::::::::::::::::::::::::::::::::::::::::::');
    FirebaseSendNotificationService.initialize(config);
    FirebasePushNotificationService.initialize(config);

    FirebasePushNotificationService().getToken();
    return MaterialApp(
      navigatorKey: navigatorKey,
      home: HomeScreen(),
    );
  }
}
0
likes
130
points
79
downloads

Publisher

verified publishermanishtalreja.in

Weekly Downloads

A Flutter package for Firebase services including authentication, notifications, media uploads, and chat features. Simplifies common Firebase operations with clean, reusable APIs.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

cloud_firestore, dio, firebase_auth, firebase_core, firebase_messaging, firebase_storage, flutter, flutter_local_notifications, googleapis_auth, http, image_picker, open_file, path, path_provider, permission_handler, url_launcher

More

Packages that depend on custom_firebase_services