custom_firebase_services 0.0.1
custom_firebase_services: ^0.0.1 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 'dart:io';
import 'package:custom_firebase_services/custom_firebase_services.dart';
import 'package:example/services/pick_image_newest.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// final AuthService authService = AuthService();
// final NotificationService notificationService = NotificationService();
final MediaUploadService storageService = MediaUploadService();
// final ChatService chatService = ChatService();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Firebase Service Example')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () async {
try {
File? imageUrl=await pickImage(context,true);
if(imageUrl!=null){
String? urls = await MediaUploadService.uploadImageAndGetUrl(imageUrl.path);
print('Uploaded files: $urls');
}
} catch (e) {
print('Error: $e');
}
},
child: Text('Upload Files'),
),
],
),
),
),
);
}
}