-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
190 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
import 'utils.dart'; | ||
|
||
/// This is the new type, App will be deprecated in the future | ||
typedef FirebaseAppOptions = AppOptions; | ||
|
||
class AppOptions { | ||
String? apiKey; | ||
String? authDomain; | ||
String? databaseURL; | ||
String? projectId; | ||
String? storageBucket; | ||
String? messagingSenderId; | ||
String? measurementId; | ||
String? appId; | ||
|
||
AppOptions( | ||
{this.apiKey, | ||
this.authDomain, | ||
this.databaseURL, | ||
this.projectId, | ||
this.storageBucket, | ||
this.messagingSenderId, | ||
this.appId, | ||
this.measurementId}); | ||
|
||
factory AppOptions.fromMap(Map<String, Object?> map) => | ||
FirebaseAppOptionsFromMap(map); | ||
|
||
Map<String, Object?> toDebugMap() { | ||
return {'apiKey': obfuscate(apiKey), projectId!: projectId}; | ||
} | ||
|
||
@override | ||
String toString() => toDebugMap().toString(); | ||
} | ||
|
||
class FirebaseAppOptionsFromMap | ||
with FirebaseAppOptionsMixin | ||
implements FirebaseAppOptions { | ||
@override | ||
String? apiKey; | ||
@override | ||
String? authDomain; | ||
@override | ||
String? databaseURL; | ||
@override | ||
String? projectId; | ||
@override | ||
String? storageBucket; | ||
@override | ||
String? messagingSenderId; | ||
@override | ||
String? measurementId; | ||
@override | ||
String? appId; | ||
|
||
FirebaseAppOptionsFromMap(Map<String, Object?> map) { | ||
apiKey = map['apiKey']?.toString(); | ||
authDomain = map['authDomain']?.toString(); | ||
databaseURL = map['databaseURL']?.toString(); | ||
projectId = map['projectId']?.toString(); | ||
storageBucket = map['storageBucket']?.toString(); | ||
messagingSenderId = map['messagingSenderId']?.toString(); | ||
measurementId = map['measurementId']?.toString(); | ||
appId = map['appId']?.toString(); | ||
} | ||
|
||
@override | ||
Map<String, Object?> toDebugMap() { | ||
return {'apiKey': obfuscate(apiKey), projectId!: projectId}; | ||
} | ||
} | ||
|
||
mixin FirebaseAppOptionsMixin implements FirebaseAppOptions { | ||
@override | ||
Map<String, Object?> toDebugMap() { | ||
return {'apiKey': obfuscate(apiKey), projectId!: projectId}; | ||
} | ||
|
||
@override | ||
String? get apiKey => throw UnimplementedError(); | ||
|
||
@override | ||
String? get appId => throw UnimplementedError(); | ||
|
||
@override | ||
String? get authDomain => throw UnimplementedError(); | ||
|
||
@override | ||
String? get databaseURL => throw UnimplementedError(); | ||
|
||
@override | ||
String? get measurementId => throw UnimplementedError(); | ||
|
||
@override | ||
String? get messagingSenderId => throw UnimplementedError(); | ||
|
||
@override | ||
String? get projectId => throw UnimplementedError(); | ||
|
||
@override | ||
String? get storageBucket => throw UnimplementedError(); | ||
|
||
@override | ||
set apiKey(String? apiKey) { | ||
throw UnsupportedError('read only'); | ||
} | ||
|
||
@override | ||
set appId(String? appId) { | ||
throw UnsupportedError('read only'); | ||
} | ||
|
||
@override | ||
set authDomain(String? authDomain) { | ||
throw UnsupportedError('read only'); | ||
} | ||
|
||
@override | ||
set databaseURL(String? databaseURL) { | ||
throw UnsupportedError('read only'); | ||
} | ||
|
||
@override | ||
set measurementId(String? measurementId) { | ||
throw UnsupportedError('read only'); | ||
} | ||
|
||
@override | ||
set messagingSenderId(String? messagingSenderId) { | ||
throw UnsupportedError('read only'); | ||
} | ||
|
||
@override | ||
set projectId(String? projectId) { | ||
throw UnsupportedError('read only'); | ||
} | ||
|
||
@override | ||
set storageBucket(String? storageBucket) { | ||
throw UnsupportedError('read only'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.