-
Notifications
You must be signed in to change notification settings - Fork 2
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
16 changed files
with
464 additions
and
31 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"project_info": { | ||
"project_number": "72220156624", | ||
"project_id": "valstore-c6e9a", | ||
"storage_bucket": "valstore-c6e9a.appspot.com" | ||
}, | ||
"client": [ | ||
{ | ||
"client_info": { | ||
"mobilesdk_app_id": "1:72220156624:android:296d995dc24c112e54b4d5", | ||
"android_client_info": { | ||
"package_name": "com.example.valstore" | ||
} | ||
}, | ||
"oauth_client": [ | ||
{ | ||
"client_id": "72220156624-0jo8lcnfnjsjiv9921c2ev2p941gajl3.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
], | ||
"api_key": [ | ||
{ | ||
"current_key": "AIzaSyCgrHLToYINvfWZ7c2AmFyFMxeAvO7u7jU" | ||
} | ||
], | ||
"services": { | ||
"appinvite_service": { | ||
"other_platform_oauth_client": [ | ||
{ | ||
"client_id": "72220156624-0jo8lcnfnjsjiv9921c2ev2p941gajl3.apps.googleusercontent.com", | ||
"client_type": 3 | ||
} | ||
] | ||
} | ||
} | ||
} | ||
], | ||
"configuration_version": "1" | ||
} |
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,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>CLIENT_ID</key> | ||
<string>72220156624-l02llpjonnn9p6thnutr1gvubo3fiktp.apps.googleusercontent.com</string> | ||
<key>REVERSED_CLIENT_ID</key> | ||
<string>com.googleusercontent.apps.72220156624-l02llpjonnn9p6thnutr1gvubo3fiktp</string> | ||
<key>API_KEY</key> | ||
<string>AIzaSyBULY3zyp24hgD4vyOVLiY7KDX2JHwzTeM</string> | ||
<key>GCM_SENDER_ID</key> | ||
<string>72220156624</string> | ||
<key>PLIST_VERSION</key> | ||
<string>1</string> | ||
<key>BUNDLE_ID</key> | ||
<string>com.example.valstore</string> | ||
<key>PROJECT_ID</key> | ||
<string>valstore-c6e9a</string> | ||
<key>STORAGE_BUCKET</key> | ||
<string>valstore-c6e9a.appspot.com</string> | ||
<key>IS_ADS_ENABLED</key> | ||
<false></false> | ||
<key>IS_ANALYTICS_ENABLED</key> | ||
<false></false> | ||
<key>IS_APPINVITE_ENABLED</key> | ||
<true></true> | ||
<key>IS_GCM_ENABLED</key> | ||
<true></true> | ||
<key>IS_SIGNIN_ENABLED</key> | ||
<true></true> | ||
<key>GOOGLE_APP_ID</key> | ||
<string>1:72220156624:ios:ef512fcf52d434ab54b4d5</string> | ||
</dict> | ||
</plist> |
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,7 @@ | ||
{ | ||
"file_generated_by": "FlutterFire CLI", | ||
"purpose": "FirebaseAppID & ProjectID for this Firebase app in this directory", | ||
"GOOGLE_APP_ID": "1:72220156624:ios:ef512fcf52d434ab54b4d5", | ||
"FIREBASE_PROJECT_ID": "valstore-c6e9a", | ||
"GCM_SENDER_ID": "72220156624" | ||
} |
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,13 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class HexColor extends Color { | ||
static int _getColorFromHex(String hexColor) { | ||
hexColor = hexColor.toUpperCase().replaceAll("#", ""); | ||
if (hexColor.length == 6) { | ||
hexColor = "FF" + hexColor; | ||
} | ||
return int.parse(hexColor, radix: 16); | ||
} | ||
|
||
HexColor(final String hexColor) : super(_getColorFromHex(hexColor)); | ||
} |
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,69 @@ | ||
// File generated by FlutterFire CLI. | ||
// ignore_for_file: lines_longer_than_80_chars, avoid_classes_with_only_static_members | ||
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: | ||
throw UnsupportedError( | ||
'DefaultFirebaseOptions have not been configured for windows - ' | ||
'you can reconfigure this by running the FlutterFire CLI again.', | ||
); | ||
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: 'AIzaSyCgrHLToYINvfWZ7c2AmFyFMxeAvO7u7jU', | ||
appId: '1:72220156624:android:296d995dc24c112e54b4d5', | ||
messagingSenderId: '72220156624', | ||
projectId: 'valstore-c6e9a', | ||
storageBucket: 'valstore-c6e9a.appspot.com', | ||
); | ||
|
||
static const FirebaseOptions ios = FirebaseOptions( | ||
apiKey: 'AIzaSyBULY3zyp24hgD4vyOVLiY7KDX2JHwzTeM', | ||
appId: '1:72220156624:ios:ef512fcf52d434ab54b4d5', | ||
messagingSenderId: '72220156624', | ||
projectId: 'valstore-c6e9a', | ||
storageBucket: 'valstore-c6e9a.appspot.com', | ||
iosClientId: '72220156624-l02llpjonnn9p6thnutr1gvubo3fiktp.apps.googleusercontent.com', | ||
iosBundleId: 'com.example.valstore', | ||
); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
class FirebaseSkin { | ||
String? name; | ||
String? offerId; | ||
String? skinId; | ||
List<Chroma>? chromas; | ||
List<Level>? levels; | ||
int? cost; | ||
String? icon; | ||
ContentTier? contentTier; | ||
|
||
FirebaseSkin( | ||
{this.name, | ||
this.offerId, | ||
this.skinId, | ||
this.cost, | ||
this.icon, | ||
this.contentTier, | ||
this.chromas, | ||
this.levels}); | ||
|
||
FirebaseSkin.fromJson(Map<String, dynamic> json) { | ||
name = json['name']; | ||
offerId = json['offer_id']; | ||
skinId = json['skin_id']; | ||
cost = json['cost']; | ||
icon = json['icon']; | ||
contentTier = json['content_tier'] != null | ||
? ContentTier.fromJson(json['content_tier']) | ||
: null; | ||
if (json['chromas'] != null) { | ||
chromas = <Chroma>[]; | ||
json['chromas'].forEach((c) { | ||
chromas!.add(Chroma.fromJson(c)); | ||
}); | ||
} | ||
if (json['levels'] != null) { | ||
levels = <Level>[]; | ||
json['levels'].forEach((c) { | ||
levels!.add(Level.fromJson(c)); | ||
}); | ||
} | ||
} | ||
} | ||
|
||
class ContentTier { | ||
String? name; | ||
String? color; | ||
String? icon; | ||
|
||
ContentTier({this.name, this.color, this.icon}); | ||
|
||
ContentTier.fromJson(Map<String, dynamic> json) { | ||
name = json['name']; | ||
color = json['color']; | ||
icon = json['icon']; | ||
} | ||
} | ||
|
||
class Chroma { | ||
String? assetPath; | ||
String? displayIcon; | ||
String? displayName; | ||
String? fullRender; | ||
String? streamedVideo; | ||
String? swatch; | ||
String? uuid; | ||
|
||
Chroma( | ||
{this.assetPath, | ||
this.displayIcon, | ||
this.displayName, | ||
this.fullRender, | ||
this.streamedVideo, | ||
this.swatch, | ||
this.uuid}); | ||
|
||
Chroma.fromJson(Map<String, dynamic> json) { | ||
assetPath = json['assetPath']; | ||
displayIcon = json['displayIcon']; | ||
displayName = json['displayName']; | ||
fullRender = json['fullRender']; | ||
streamedVideo = json['streamedVideo']; | ||
swatch = json['swatch']; | ||
uuid = json['uuid']; | ||
} | ||
} | ||
|
||
class Level { | ||
String? assetPath; | ||
String? displayIcon; | ||
String? displayName; | ||
String? fullRender; | ||
String? streamedVideo; | ||
String? swatch; | ||
String? uuid; | ||
|
||
Level( | ||
{this.assetPath, | ||
this.displayIcon, | ||
this.displayName, | ||
this.fullRender, | ||
this.streamedVideo, | ||
this.swatch, | ||
this.uuid}); | ||
|
||
Level.fromJson(Map<String, dynamic> json) { | ||
assetPath = json['assetPath']; | ||
displayIcon = json['displayIcon']; | ||
displayName = json['displayName']; | ||
fullRender = json['fullRender']; | ||
streamedVideo = json['streamedVideo']; | ||
swatch = json['swatch']; | ||
uuid = json['uuid']; | ||
} | ||
} |
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,14 @@ | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:valstore/models/firebase_skin.dart'; | ||
|
||
class FireStoreService { | ||
final FirebaseFirestore _db = FirebaseFirestore.instance; | ||
|
||
Future<FirebaseSkin?> getSkin(String uuid) async { | ||
var docRef = _db.collection("skins").doc(uuid); | ||
|
||
var snapshot = await docRef.get(); | ||
|
||
return FirebaseSkin.fromJson(snapshot.data()!); | ||
} | ||
} |
Oops, something went wrong.