- Added Firebase configuration to Android and iOS projects. - Created `google-services.json` and `GoogleService-Info.plist` for Firebase setup. - Implemented `AuthService` for handling user authentication with Firebase. - Updated `UserProvider` to manage user data with Firestore. - Refactored `ProfileContent`, `LoginPage`, and `SignUpPage` to use the new authentication service. - Removed the old `UserService` and replaced it with Firestore-based user management. - Added Firebase options in `firebase_options.dart` for platform-specific configurations. - Updated dependencies in `pubspec.yaml` for Firebase packages.
77 lines
2.6 KiB
Dart
77 lines
2.6 KiB
Dart
// File generated by FlutterFire CLI.
|
|
// ignore_for_file: type=lint
|
|
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
|
import 'package:flutter/foundation.dart'
|
|
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
|
|
|
/// Default [FirebaseOptions] for use with your Firebase apps.
|
|
///
|
|
/// Example:
|
|
/// ```dart
|
|
/// import 'firebase_options.dart';
|
|
/// // ...
|
|
/// await Firebase.initializeApp(
|
|
/// options: DefaultFirebaseOptions.currentPlatform,
|
|
/// );
|
|
/// ```
|
|
class DefaultFirebaseOptions {
|
|
static FirebaseOptions get currentPlatform {
|
|
if (kIsWeb) {
|
|
throw UnsupportedError(
|
|
'DefaultFirebaseOptions have not been configured for web - '
|
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
|
);
|
|
}
|
|
switch (defaultTargetPlatform) {
|
|
case TargetPlatform.android:
|
|
return android;
|
|
case TargetPlatform.iOS:
|
|
return ios;
|
|
case TargetPlatform.macOS:
|
|
throw UnsupportedError(
|
|
'DefaultFirebaseOptions have not been configured for macos - '
|
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
|
);
|
|
case TargetPlatform.windows:
|
|
return windows;
|
|
case TargetPlatform.linux:
|
|
throw UnsupportedError(
|
|
'DefaultFirebaseOptions have not been configured for linux - '
|
|
'you can reconfigure this by running the FlutterFire CLI again.',
|
|
);
|
|
default:
|
|
throw UnsupportedError(
|
|
'DefaultFirebaseOptions are not supported for this platform.',
|
|
);
|
|
}
|
|
}
|
|
|
|
static const FirebaseOptions android = FirebaseOptions(
|
|
apiKey: 'AIzaSyAON_ol0Jr34tKbETvdDK9JCQdKNawxBeQ',
|
|
appId: '1:521527250907:android:be3db7fc84f053ec7da1fe',
|
|
messagingSenderId: '521527250907',
|
|
projectId: 'travelmate-a47f5',
|
|
storageBucket: 'travelmate-a47f5.firebasestorage.app',
|
|
);
|
|
|
|
static const FirebaseOptions ios = FirebaseOptions(
|
|
apiKey: 'AIzaSyBFaSzvcvO8qg7El-2jRf7WctZIMKNA4-I',
|
|
appId: '1:521527250907:ios:64b41be39c54db1c7da1fe',
|
|
messagingSenderId: '521527250907',
|
|
projectId: 'travelmate-a47f5',
|
|
storageBucket: 'travelmate-a47f5.firebasestorage.app',
|
|
iosClientId: '521527250907-3i1qe2656eojs8k9hjdi573j09i9p41m.apps.googleusercontent.com',
|
|
iosBundleId: 'com.example.travelMate',
|
|
);
|
|
|
|
static const FirebaseOptions windows = FirebaseOptions(
|
|
apiKey: 'AIzaSyC4t-WOvp22zns9b9t58urznsNAhSHRAag',
|
|
appId: '1:521527250907:web:53ff98bcdb8c218f7da1fe',
|
|
messagingSenderId: '521527250907',
|
|
projectId: 'travelmate-a47f5',
|
|
authDomain: 'travelmate-a47f5.firebaseapp.com',
|
|
storageBucket: 'travelmate-a47f5.firebasestorage.app',
|
|
measurementId: 'G-J246Y7J61M',
|
|
);
|
|
|
|
} |