Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalrk1 committed Dec 20, 2021
1 parent 3ced9f3 commit c4b2a70
Show file tree
Hide file tree
Showing 55 changed files with 1,422 additions and 1,208 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
}
android {

compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -42,7 +42,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.vk.MegaLinks" //com.example.onikiri_ui
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
Expand Down
68 changes: 68 additions & 0 deletions android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"project_info": {
"project_number": "619239255934",
"project_id": "editing-app-de1f1",
"storage_bucket": "editing-app-de1f1.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:619239255934:android:ffb473798ea5645ade8d2f",
"android_client_info": {
"package_name": "com.example.onikiri_ui"
}
},
"oauth_client": [
{
"client_id": "619239255934-ggl3c58nll58deiuhp7gbaasagnn7154.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyByHFSZ-G1j4XzqYOsU0R4i9ceGtvCFJk4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "619239255934-ggl3c58nll58deiuhp7gbaasagnn7154.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:619239255934:android:de9e1bba753a709bde8d2f",
"android_client_info": {
"package_name": "com.vk.MegaLinks"
}
},
"oauth_client": [
{
"client_id": "619239255934-ggl3c58nll58deiuhp7gbaasagnn7154.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyByHFSZ-G1j4XzqYOsU0R4i9ceGtvCFJk4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "619239255934-ggl3c58nll58deiuhp7gbaasagnn7154.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
],
"configuration_version": "1"
}
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.5.10'
repositories {
google()
jcenter()
Expand Down
12 changes: 1 addition & 11 deletions lib/AnimeRaw_links/AnimeRaw_detail_screen.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:auto_animated/auto_animated.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/material.dart';
import 'package:onikiri_ui/DataProvider/DataProvider.dart';
import 'package:onikiri_ui/Widgets/AppDrawer.dart';
Expand All @@ -12,24 +11,15 @@ import 'Anime_InfoCard.dart';
class AnimeRawDetailsPage extends StatefulWidget {
static const routeName = '/animedetails-page';

// final heroTag;
// final title;
// final Details;
// //final List<Scource> avaibleRaws;

// AnimeRawDetailsPage({this.heroTag, this.title, this.Details});

@override
_AnimeRawDetailsPageState createState() => _AnimeRawDetailsPageState();
}

class _AnimeRawDetailsPageState extends State<AnimeRawDetailsPage> {
// var selectedCard = 'WEIGHT';

@override
Widget build(BuildContext context) {
final Category loadedData =
ModalRoute.of(context).settings.arguments as Category;
ModalRoute.of(context)!.settings.arguments as Category;
final dataProvider = Provider.of<DataProvider>(context);
final List<AnimeModel> rawList =
Provider.of<DataProvider>(context).animeRawList;
Expand Down
88 changes: 62 additions & 26 deletions lib/AnimeRaw_links/Anime_InfoCard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,82 @@ import 'package:flutter/material.dart';
import 'package:google_mobile_ads/google_mobile_ads.dart';
import 'package:onikiri_ui/Colors.dart';
import 'package:onikiri_ui/adds/ad_Id.dart';
import 'package:onikiri_ui/adds/ad_state.dart';
import 'package:onikiri_ui/helpers/Url_Launcher.dart';
import 'package:onikiri_ui/models/AnimeModel.dart';
import 'package:provider/provider.dart';

import '../main.dart';

class AnimeRawInfoCard extends StatefulWidget {
final AnimeModel animeRaw;

AnimeRawInfoCard({this.animeRaw});
AnimeRawInfoCard({required this.animeRaw});

@override
_AnimeRawInfoCardState createState() => _AnimeRawInfoCardState();
}

class _AnimeRawInfoCardState extends State<AnimeRawInfoCard> {
InterstitialAd _interstitialAd;
InterstitialAd? _interstitialAd;
bool _isInterstitialAdReady = false;
int _numInterstitialLoadAttempts = 1;

@override
void didChangeDependencies() {
super.didChangeDependencies();
final adState = Provider.of<AdState>(context);
final adProvider = Provider.of<AdMob>(context);
adState.initialization.then(
(value) {
InterstitialAd.load(
adUnitId: adProvider.interstitialAd,
request: AdRequest(),
adLoadCallback: InterstitialAdLoadCallback(
onAdLoaded: (InterstitialAd ad) {
// Keep a reference to the ad so you can show it later.
this._interstitialAd = ad;
},
onAdFailedToLoad: (LoadAdError error) {
print('InterstitialAd failed to load: $error');
Navigator.of(context).pop();
},
),
);
void initState() {
super.initState();
_createInterstitialAd();
}

void _createInterstitialAd() {
InterstitialAd.load(
adUnitId: AdMob().interstitialAd,
request: AdRequest(),
adLoadCallback: InterstitialAdLoadCallback(
onAdLoaded: (InterstitialAd ad) {
print('$ad loaded');
_interstitialAd = ad;
_numInterstitialLoadAttempts = 0;
_interstitialAd!.setImmersiveMode(true);
_isInterstitialAdReady = true;
},
onAdFailedToLoad: (LoadAdError error) {
print('InterstitialAd failed to load: $error.');
_numInterstitialLoadAttempts += 1;
_interstitialAd = null;
_isInterstitialAdReady = false;
if (_numInterstitialLoadAttempts <= maxFailedLoadAttempts) {
_createInterstitialAd();
}
},
));
}

void _showInterstitialAd() {
if (_interstitialAd == null) {
print('Warning: attempt to show interstitial before loaded.');
return;
}
_interstitialAd!.fullScreenContentCallback = FullScreenContentCallback(
onAdShowedFullScreenContent: (InterstitialAd ad) =>
print('ad onAdShowedFullScreenContent.'),
onAdDismissedFullScreenContent: (InterstitialAd ad) {
print('$ad onAdDismissedFullScreenContent.');
ad.dispose();
_createInterstitialAd();
},
onAdFailedToShowFullScreenContent: (InterstitialAd ad, AdError error) {
print('$ad onAdFailedToShowFullScreenContent: $error');
ad.dispose();
_createInterstitialAd();
},
);
_interstitialAd!.show();
_interstitialAd = null;
}

@override
void dispose() {
super.dispose();
_interstitialAd!.dispose();
}

@override
Expand Down Expand Up @@ -94,8 +130,8 @@ class _AnimeRawInfoCardState extends State<AnimeRawInfoCard> {
child: IconButton(
onPressed: () {
UrlLauncher().launchInBrowser(widget.animeRaw.link);
if (_interstitialAd.show() != null) {
_interstitialAd.show();
if (_isInterstitialAdReady == true) {
_showInterstitialAd();
}
},
icon: Icon(Icons.arrow_forward_ios),
Expand Down
19 changes: 12 additions & 7 deletions lib/DataProvider/DataProvider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:onikiri_ui/models/TutorialModel.dart';
class DataProvider with ChangeNotifier {
bool isLoding = true;
bool isError = false;
String errorMessage;
late String errorMessage;
List<ScenePackModel> scenePackList = [];
List<TutorialModel> tutorialsList = [];
List<AnimeModel> animeRawList = [];
Expand All @@ -29,7 +29,8 @@ class DataProvider with ChangeNotifier {
await FirebaseFirestore.instance.collection(SCENE_PACKS).get();
List<ScenePackModel> items = [];
ref.docs.forEach((DocumentSnapshot doc) {
ScenePackModel scenePack = ScenePackModel.fromJson(doc.data());
ScenePackModel scenePack =
ScenePackModel.fromJson(doc.data() as Map<String, dynamic>);
items.add(scenePack);
});
scenePackList = items;
Expand All @@ -55,7 +56,8 @@ class DataProvider with ChangeNotifier {
.get();
List<TutorialModel> items = [];
ref.docs.forEach((DocumentSnapshot doc) {
TutorialModel tut = TutorialModel.fromJson(doc.data());
TutorialModel tut =
TutorialModel.fromJson(doc.data() as Map<String, dynamic>);
items.add(tut);
});
tutorialsList = items;
Expand All @@ -79,7 +81,8 @@ class DataProvider with ChangeNotifier {
await FirebaseFirestore.instance.collection(ANIME_RAWS).get();
List<AnimeModel> items = [];
ref.docs.forEach((DocumentSnapshot doc) {
AnimeModel raw = AnimeModel.fromJson(doc.data());
AnimeModel raw =
AnimeModel.fromJson(doc.data() as Map<String, dynamic>);
items.add(raw);
});
animeRawList = items;
Expand All @@ -105,7 +108,7 @@ class DataProvider with ChangeNotifier {
.get();
List<PfModel> items = [];
ref.docs.forEach((DocumentSnapshot doc) {
PfModel file = PfModel.fromJson(doc.data());
PfModel file = PfModel.fromJson(doc.data() as Map<String, dynamic>);
items.add(file);
});
projectFileList = items;
Expand All @@ -129,7 +132,8 @@ class DataProvider with ChangeNotifier {
await FirebaseFirestore.instance.collection(FEEDBACK).get();
List<FeedBackModel> items = [];
ref.docs.forEach((DocumentSnapshot doc) {
FeedBackModel feedBack = FeedBackModel.fromJson(doc.data());
FeedBackModel feedBack =
FeedBackModel.fromJson(doc.data() as Map<String, dynamic>);
items.add(feedBack);
});
feedBacksList = items;
Expand All @@ -155,7 +159,8 @@ class DataProvider with ChangeNotifier {
.get();
List<PresetPackModel> items = [];
ref.docs.forEach((DocumentSnapshot doc) {
PresetPackModel pack = PresetPackModel.fromJson(doc.data());
PresetPackModel pack =
PresetPackModel.fromJson(doc.data() as Map<String, dynamic>);
items.add(pack);
});
presetList = items;
Expand Down
2 changes: 1 addition & 1 deletion lib/DataProvider/DataUploader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'FireBase_Constants.dart';
class DataUploadProvider with ChangeNotifier {
bool isLoding = true;
bool isError = false;
String errorMessage;
late String errorMessage;

Future<void> uploadScenePack(Map<String, dynamic> inputData) async {
try {
Expand Down
2 changes: 1 addition & 1 deletion lib/FeedBack/User_feedBack_Screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FeedBackCard extends StatelessWidget {
final String feedback;
final String name;

FeedBackCard({this.feedback, this.name});
FeedBackCard({required this.feedback, required this.name});

@override
Widget build(BuildContext context) {
Expand Down
12 changes: 6 additions & 6 deletions lib/FeedBack/feedBack_Screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ class _FeedBackScreenState extends State<FeedBackScreen> {
super.dispose();
}

CollectionReference _ref;
late CollectionReference _ref;
@override
void initState() {
super.initState();
_ref = FirebaseFirestore.instance.collection('Feedback');
}

void _saveForm() {
final isValid = _form.currentState.validate();
final isValid = _form.currentState!.validate();
if (!isValid) {
return;
}
_form.currentState.save();
_form.currentState!.save();
setState(() {
_isLoading = true;
});
Expand Down Expand Up @@ -109,7 +109,7 @@ class _FeedBackScreenState extends State<FeedBackScreen> {
begin: Alignment.bottomCenter,
end: Alignment.center,
colors: <Color>[
Colors.purpleAccent[100],
Colors.purpleAccent[100]!,
Colors.transparent,
]),
),
Expand Down Expand Up @@ -185,7 +185,7 @@ class _FeedBackScreenState extends State<FeedBackScreen> {
data['name'] = value;
},
validator: (value) {
if (value.isEmpty) {
if (value!.isEmpty) {
return 'Please Entre Something';
}
return null;
Expand All @@ -207,7 +207,7 @@ class _FeedBackScreenState extends State<FeedBackScreen> {
data['feedback'] = value;
},
validator: (value) {
if (value.isEmpty) {
if (value!.isEmpty) {
return 'Please Entre Something';
}
return null;
Expand Down
2 changes: 1 addition & 1 deletion lib/HomePage/AnimatedText/Header_Animated_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:onikiri_ui/Colors.dart';

class HomeAnimatedText extends StatelessWidget {
const HomeAnimatedText({
Key key,
Key? key,
}) : super(key: key);

@override
Expand Down

0 comments on commit c4b2a70

Please sign in to comment.