This file contains hidden or 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
imagePicker() { | |
return ImagePickerWeb.getImageInfo.then((MediaInfo mediaInfo) { | |
uploadFile(mediaInfo, 'images', mediaInfo.fileName); | |
}); | |
} |
This file contains hidden or 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
//Getting Downloaded URI directly | |
uploadFile(MediaInfo mediaInfo, String ref, String fileName) { | |
try { | |
String mimeType = mime(basename(mediaInfo.fileName)); | |
var metaData = UploadMetadata(contentType: mimeType); | |
StorageReference storageReference = storage().ref(ref).child(fileName); | |
UploadTask uploadTask = storageReference.put(mediaInfo.data, metaData); | |
var imageUri; | |
uploadTask.future.then((snapshot) => { |
This file contains hidden or 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
import android.util.Log | |
import com.google.firebase.firestore.CollectionReference | |
import com.google.firebase.firestore.Query | |
import com.google.firebase.firestore.ktx.firestore | |
import com.google.firebase.ktx.Firebase | |
import com.midsizemango.scribblergame.Constants.Companion.FIRESTORE | |
class FirestoreAPI(collectionName: String) { | |
private val db = Firebase.firestore | |
private var collectionRef: CollectionReference |
This file contains hidden or 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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Flutter", | |
"request": "launch", | |
"type": "dart", | |
"args": [ | |
"--web-hostname", | |
"localhost", |
This file contains hidden or 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
//Call this method to Invoke GoogleSignIn Functionality | |
FirebaseGoogleAuthentication.signInWithGoogle() | |
.whenComplete(() { | |
Navigator.pop(context); | |
Navigator.push(context,MaterialPageRoute(builder: (_) => MainPage())); | |
}) |
This file contains hidden or 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
import 'package:firebase_auth/firebase_auth.dart'; | |
class User { | |
String id; | |
String name; | |
String imageUrl; | |
String email; | |
String address; |
This file contains hidden or 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
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:flutterapp/constants.dart'; | |
import 'package:flutterapp/core/models/user_model.dart'; | |
import 'package:flutterapp/persistance/user_box.dart'; | |
import 'package:google_sign_in/google_sign_in.dart'; | |
class FirebaseGoogleAuthentication { | |
static final FirebaseAuth firebaseAuth = FirebaseAuth.instance; | |
static final GoogleSignIn googleSignIn = GoogleSignIn(); |