Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id "com.android.application"
// START: FlutterFire Configuration
id 'com.google.gms.google-services'
id 'com.google.firebase.firebase-perf'
// END: FlutterFire Configuration
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
Expand Down
1 change: 1 addition & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ plugins {
id "com.android.application" version "7.3.0" apply false
// START: FlutterFire Configuration
id "com.google.gms.google-services" version "4.3.15" apply false
id "com.google.firebase.firebase-perf" version "1.4.1" apply false
// END: FlutterFire Configuration
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
}
Expand Down
16 changes: 16 additions & 0 deletions lib/services/game_library_S/game_service.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';
import 'package:firebase_performance/firebase_performance.dart';
import 'package:gameonconnect/cache_managers/game_cache_manager.dart';
import 'package:gameonconnect/model/game_library_M/game_model.dart';
import '../../../globals.dart' as global;
Expand Down Expand Up @@ -31,10 +32,15 @@
.map((gameJson) => Game.fromJson(gameJson))
.toList();
} else {
Trace myTrace = FirebasePerformance.instance.newTrace("fetchGames_trace");
myTrace.start();

Check warning on line 36 in lib/services/game_library_S/game_service.dart

View check run for this annotation

Codecov / codecov/patch

lib/services/game_library_S/game_service.dart#L35-L36

Added lines #L35 - L36 were not covered by tests

//Load the games from API
final response = await http.get(Uri.parse(
'https://api.rawg.io/api/games?key=${global.apiKey}$request'));

myTrace.stop();

Check warning on line 42 in lib/services/game_library_S/game_service.dart

View check run for this annotation

Codecov / codecov/patch

lib/services/game_library_S/game_service.dart#L42

Added line #L42 was not covered by tests

if (response.statusCode == 200) {
//Cache data
await GameCacheManager().putFile(
Expand Down Expand Up @@ -63,9 +69,14 @@
final jsonData = jsonDecode(await fileInfo.file.readAsString());
return GameDetails.fromJson(jsonData);
} else {
Trace myTrace = FirebasePerformance.instance.newTrace("fetchGameDetails_trace");
myTrace.start();

Check warning on line 73 in lib/services/game_library_S/game_service.dart

View check run for this annotation

Codecov / codecov/patch

lib/services/game_library_S/game_service.dart#L72-L73

Added lines #L72 - L73 were not covered by tests

//Load the games from API
final response = await http.get(Uri.parse(request));

myTrace.stop();

Check warning on line 78 in lib/services/game_library_S/game_service.dart

View check run for this annotation

Codecov / codecov/patch

lib/services/game_library_S/game_service.dart#L78

Added line #L78 was not covered by tests

if (response.statusCode == 200) {
//Cache data
await GameDetailsCacheManager().putFile(
Expand All @@ -92,9 +103,14 @@
List<dynamic> screenshotJson = jsonData['results'];
return screenshotJson.map((json) => Screenshot.fromJson(json)).toList();
} else {
Trace myTrace = FirebasePerformance.instance.newTrace("fetchGameScreenshots_trace");
myTrace.start();

Check warning on line 107 in lib/services/game_library_S/game_service.dart

View check run for this annotation

Codecov / codecov/patch

lib/services/game_library_S/game_service.dart#L106-L107

Added lines #L106 - L107 were not covered by tests

//Load the games from API
final response = await http.get(Uri.parse(request));

myTrace.stop();

Check warning on line 112 in lib/services/game_library_S/game_service.dart

View check run for this annotation

Codecov / codecov/patch

lib/services/game_library_S/game_service.dart#L112

Added line #L112 was not covered by tests

if (response.statusCode == 200) {
//Cache data
await GameDetailsCacheManager().putFile(
Expand Down
52 changes: 38 additions & 14 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.18.1"
firebase_performance:
dependency: "direct main"
description:
name: firebase_performance
sha256: ed9a408b6d1f221fc0e2890dcf0733b604d1aea6cd3b897f97dd3f889f01ddfc
url: "https://pub.dev"
source: hosted
version: "0.10.0+7"
firebase_performance_platform_interface:
dependency: transitive
description:
name: firebase_performance_platform_interface
sha256: bfcfbfcefeaf3853a72602675b786e13a609d49ac70fc325d302b5794b8b0c06
url: "https://pub.dev"
source: hosted
version: "0.1.4+43"
firebase_performance_web:
dependency: transitive
description:
name: firebase_performance_web
sha256: "2ac9e44a1be7b20f1a7a3912d84bf2e1ec76398f2dadc07b6b7c3173d590e329"
url: "https://pub.dev"
source: hosted
version: "0.1.7+1"
firebase_storage:
dependency: "direct main"
description:
Expand Down Expand Up @@ -891,18 +915,18 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.4"
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.3"
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
Expand Down Expand Up @@ -963,18 +987,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.8.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.12.0"
version: "1.15.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -1171,10 +1195,10 @@ packages:
dependency: transitive
description:
name: platform
sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec"
sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65"
url: "https://pub.dev"
source: hosted
version: "3.1.4"
version: "3.1.5"
plugin_platform_interface:
dependency: transitive
description:
Expand Down Expand Up @@ -1376,10 +1400,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.7.0"
version: "0.7.2"
tiled:
dependency: transitive
description:
Expand Down Expand Up @@ -1568,10 +1592,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.1"
version: "14.2.5"
wakelock_plus:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ dependencies:
flame_audio: ^2.10.3
share_plus: ^10.0.0
super_tooltip: ^2.0.8

firebase_performance: ^0.10.0+7



Expand Down
Loading