Skip to content

Commit

Permalink
Pokedex with Flutter
Browse files Browse the repository at this point in the history
  • Loading branch information
imayush-chauhan committed Nov 25, 2021
1 parent 7c70111 commit ee8ea1a
Show file tree
Hide file tree
Showing 26 changed files with 823 additions and 287 deletions.
5 changes: 3 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -37,7 +37,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.blackhole.pokidexayu.pokidexayu"
minSdkVersion 23
targetSdkVersion 30
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand All @@ -58,5 +58,6 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:29.0.0')
implementation 'com.google.android.gms:play-services-ads:20.5.0'
implementation 'com.google.firebase:firebase-analytics-ktx'
}
3 changes: 3 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-3940256099942544~3347511713"/>
</application>
</manifest>
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
140 changes: 140 additions & 0 deletions lib/ads/ads.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
// import 'package:google_mobile_ads/google_mobile_ads.dart';
// import 'package:pokidexayu/data/data.dart';
//
// class Ads {
//
// // @override
// // void initState() {
// // super.initState();
// // getHighScore();
// // first();
// // Future.delayed(Duration(milliseconds: 5),(){
// // timeLeft();
// // });
// // Future.delayed(Duration(milliseconds: 10),(){
// // if(Data.showAds == true){
// // bannerAds();
// // loadInAd();
// // loadReAds();
// // }
// // });
// // }
// //
// // @override
// // void dispose() {
// // super.dispose();
// // timer?.cancel();
// // if(Data.showAds == true){
// // _ad?.dispose();
// // }
// // }
//
// BannerAd? _ad;
//
// bannerAds(){
// if(Data.showAds == true){
// _ad = BannerAd(
// adUnitId: "ca-app-pub-3028010056599796/1626317951",
// // adUnitId: BannerAd.testAdUnitId,
// size: AdSize.banner,
// request: AdRequest(),
// listener: BannerAdListener(
// onAdLoaded: (_){
// setState(() {
// isLoaded = true;
// });
// },
// onAdFailedToLoad: (_ad,error){
// print("Ad failed to load on Error: $error");
// }
// ),
// );
// }
// }
//
// checkForAd(){
// if(Data.showAds == true){
// if(isLoaded == true){
// return Container(
// child: Center(
// child: AdWidget(
// ad: _ad,
// ),
// ),
// height: 50,
// width: 320,
// alignment: Alignment.center,
// );
// }else{
// return Container(
// height: 50,
// width: 320,
// );
// }
// }else{
// return Container(
// height: 50,
// width: 320,
// );
// }
// }
//
// InterstitialAd _in;
//
// loadInAd(){
// if(Data.showAds == true){
// _in = InterstitialAd(
// adUnitId: "ca-app-pub-3028010056599796/1055294705",
// // adUnitId: InterstitialAd.testAdUnitId,
// request: AdRequest(
// keywords: ["amazon", "games", "land", "collage","toys","learn","coding","food"],
// ),
// listener: AdListener(
// onAdLoaded: (_){
// setState(() {
// isLoadedIn = true;
// });
// },
// onAdFailedToLoad: (_ad,error){
// print("Ad failed to load on Error: $error");
// }
// ),
// );
// _in.load();
// }
// }
//
// showInAd(){
// if(isLoadedIn == true){
// _in.show();
// }
// }
//
// RewardedAd _re;
//
// loadReAds(){
// if(Data.showAds == true){
// _re = RewardedAd(
// adUnitId: 'ca-app-pub-3028010056599796/3446334882',
// // adUnitId: RewardedAd.testAdUnitId,
// request: AdRequest(
// keywords: ["amazon", "games", "land", "collage","toys","learn","coding","food"],),
// listener: AdListener(
// onRewardedAdUserEarnedReward: (RewardedAd ad, RewardItem reward) {
// },
// onAdFailedToLoad: (Ad ad, LoadAdError error) {
// },
// ),
// );
// _re.load();
// }
// }
//
// showReAds(){
// if(Data.showAds == true){
// _re.show();
// }
// }
//
//
// }
2 changes: 2 additions & 0 deletions lib/data/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class Data {
static String n = "Loading...";
static int inx = 0;

static bool showAds = true;

}


2 changes: 2 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';
import 'package:pokidexayu/pokemon/introduction%20screen.dart';
import 'package:pokidexayu/pokemon/pokemon.dart';

void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
await MobileAds.instance.initialize();
runApp(MyApp());
}

Expand Down

0 comments on commit ee8ea1a

Please sign in to comment.