Skip to content

Commit

Permalink
new firebase mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
alextekartik committed Aug 1, 2024
1 parent 68ca23e commit 9b31814
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion auth_flutter/lib/src/auth_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class _UserFlutterImpl implements User, UserInfoWithIdToken {

/// Flutter impl
class AuthFlutterImpl
with FirebaseAppProductMixin, FirebaseAuthMixin
with FirebaseAppProductMixin<FirebaseAuth>, FirebaseAuthMixin
implements AuthFlutter {
/// The native instance
final native.FirebaseAuth nativeAuth;
Expand Down
9 changes: 5 additions & 4 deletions firestore_flutter/lib/src/firestore_flutter.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:cloud_firestore/cloud_firestore.dart' as native;
import 'package:flutter/foundation.dart';
import 'package:path/path.dart';
import 'package:tekartik_firebase/firebase_mixin.dart';
import 'package:tekartik_firebase_flutter/src/firebase_flutter.dart'; // ignore: implementation_imports

import 'aggregate_query_flutter.dart';
Expand All @@ -20,9 +21,7 @@ FirestoreService get firestoreServiceFlutter =>
_firestoreServiceFlutter ?? FirestoreServiceFlutter();

class FirestoreServiceFlutter
with
FirestoreServiceDefaultMixin,
FirebaseProductServiceMixin<FirestoreFlutter>
with FirebaseProductServiceMixin<Firestore>, FirestoreServiceDefaultMixin
implements FirestoreService {
@override
FirestoreFlutter firestore(App app) {
Expand Down Expand Up @@ -68,7 +67,9 @@ class FirestoreServiceFlutter
bool get supportsAggregateQueries => true;
}

class FirestoreFlutter with FirestoreDefaultMixin implements Firestore {
class FirestoreFlutter
with FirebaseAppProductMixin<Firestore>, FirestoreDefaultMixin
implements Firestore {
@override
final FirestoreServiceFlutter service;
final native.FirebaseFirestore nativeInstance;
Expand Down
5 changes: 5 additions & 0 deletions firestore_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ dependencies:
ref: dart3a
version: '>=0.6.0'
cloud_firestore: '>=4.14.0'
tekartik_firebase:
git:
url: https://github.com/tekartik/firebase.dart
ref: dart3a
path: firebase

dev_dependencies:
flutter_test:
Expand Down
9 changes: 7 additions & 2 deletions functions_call_flutter/lib/src/functions_call_flutter.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:cloud_functions/cloud_functions.dart' as native;
import 'package:tekartik_common_utils/common_utils_import.dart';
import 'package:tekartik_firebase/firebase.dart';
import 'package:tekartik_firebase/firebase_mixin.dart';
// ignore: implementation_imports
import 'package:tekartik_firebase_flutter/src/firebase_flutter.dart'
show FirebaseAppFlutter;
Expand All @@ -16,7 +17,9 @@ FirebaseFunctionsCallService get firebaseFunctionsCallServiceFlutter =>

/// Firebase functions call service flutter
class FirebaseFunctionsCallServiceFlutter
with FirebaseFunctionsCallServiceDefaultMixin
with
FirebaseProductServiceMixin<FirebaseFunctionsCall>,
FirebaseFunctionsCallServiceDefaultMixin
implements FirebaseFunctionsCallService {
/// Most implementation need a single instance, keep it in memory!
final _instances = <String, FirebaseFunctionsCallFlutter>{};
Expand Down Expand Up @@ -48,7 +51,9 @@ class FirebaseFunctionsCallServiceFlutter
}

/// Firebase functions call flutter
class FirebaseFunctionsCallFlutter implements FirebaseFunctionsCall {
class FirebaseFunctionsCallFlutter
with FirebaseAppProductMixin<FirebaseFunctionsCall>
implements FirebaseFunctionsCall {
/// Service
final FirebaseFunctionsCallServiceFlutter service;

Expand Down
4 changes: 3 additions & 1 deletion storage_flutter/lib/src/storage_flutter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import 'package:tekartik_firebase_storage/utils/link.dart';

import 'import.dart';

class StorageServiceFlutter with StorageServiceMixin implements StorageService {
class StorageServiceFlutter
with FirebaseProductServiceMixin<FirebaseStorage>, StorageServiceMixin
implements StorageService {
StorageServiceFlutter();

@override
Expand Down

0 comments on commit 9b31814

Please sign in to comment.