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
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
home: MyWidget(), | |
), | |
); | |
} |
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
class _GameRouteState extends State<GameRoute> implements QuizEventListener { | |
... | |
// TODO: Add _isRewardedAdReady | |
bool _isRewardedAdReady; | |
... | |
// TODO: Implement _loadRewardedAd() |
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
@override | |
void onGameOver(int correctAnswers) { | |
showDialog( | |
context: _scaffoldKey.currentContext, | |
builder: (context) { | |
return AlertDialog( | |
title: Text('Game over!'), | |
content: Text('Score: $correctAnswers/5'), | |
actions: <Widget>[ | |
FlatButton( |
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
class _GameRouteState extends State<GameRoute> implements QuizEventListener { | |
... | |
// TODO: Add _interstitialAd | |
InterstitialAd _interstitialAd; | |
// TODO: Add _isInterstitialAdReady | |
bool _isInterstitialAdReady; |
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
// TODO: Import ad_manager.dart | |
import 'package:awesome_drawing_quiz/ad_manager.dart'; | |
import 'package:awesome_drawing_quiz/app_theme.dart'; | |
// TODO: Import firebase_admob.dart | |
import 'package:firebase_admob/firebase_admob.dart'; | |
import 'package:flutter/material.dart'; |
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
import 'dart:io'; | |
class AdManager { | |
static String get appId { | |
if (Platform.isAndroid) { | |
return "<YOUR_ANDROID_ADMOB_APP_ID>"; | |
} else if (Platform.isIOS) { | |
return "<YOUR_IOS_ADMOB_APP_ID>"; | |
} else { |
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
Firestore.instance | |
.collection("images") | |
.where("name", isEqualTo: "travelimage4") | |
.getDocuments() | |
.then((res) { | |
res.documents.forEach((result) { | |
FirebaseStorage.instance | |
.getReferenceFromUrl(result.data["url"]) | |
.then((res) { | |
res.delete().then((res) { |
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
if (snapshot.error == null) { | |
final String downloadUrl = | |
await snapshot.ref.getDownloadURL(); | |
await Firestore.instance | |
.collection("images") | |
.add({"url": downloadUrl, "name": imageName}); | |
setState(() { | |
isLoading = false; | |
}); | |
final snackBar = |
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
Widget build(BuildContext context) { | |
Future getImage() async { | |
var image = await ImagePicker.pickImage(source: ImageSource.gallery); | |
setState(() { | |
_image = image; | |
print('Image Path $_image'); | |
}); |
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
rules_version = '2'; | |
service firebase.storage { | |
match /b/{bucket}/o { | |
match /{allPaths=**} { | |
allow read, write: if true; | |
} | |
} | |
} |
NewerOlder