From c10ae5b2691cd14235dbfe8cb3e7995133b640ea Mon Sep 17 00:00:00 2001 From: Prisha Jain Date: Thu, 12 Nov 2026 19:16:32 -0800 Subject: [PATCH] testing the user_profile API --- analysis_options.yaml | 2 ++ lib/core/services/user.dart | 11 ++++++++++- pubspec.lock | 16 ++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index 49186ac53..f01b49788 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1,6 +1,8 @@ analyzer: exclude: - build/** + - android/** + - ios/** formatter: page_width: 120 diff --git a/lib/core/services/user.dart b/lib/core/services/user.dart index 44264d534..ac3eca343 100644 --- a/lib/core/services/user.dart +++ b/lib/core/services/user.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:campus_mobile_experimental/app_networking.dart'; import 'package:campus_mobile_experimental/core/models/user_profile.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter_dotenv/flutter_dotenv.dart'; class UserProfileService { @@ -18,11 +19,19 @@ class UserProfileService { _error = null; _isLoading = true; try { + // TODO(prisha): temporary debug logging to inspect raw user profile JSON; remove before committing. + final rawResponse = await NetworkHelper.authorizedFetch(_endpoint + '/profile', headers); + if (kDebugMode) { + debugPrint('USER PROFILE RAW: $rawResponse'); + } _userProfileModel = userProfileModelFromJson( - await NetworkHelper.authorizedFetch(_endpoint + '/profile', headers), + rawResponse, ); return true; } catch (e) { + if (kDebugMode) { + debugPrint('USER PROFILE FETCH FAILED: $e'); + } _error = e.toString(); return false; } finally { diff --git a/pubspec.lock b/pubspec.lock index cea49646f..0928acbd9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -845,10 +845,10 @@ packages: dependency: transitive description: name: matcher - sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 + sha256: "31bd099b47c10cd1aeb55146a2d46ce0277630ecef3f7dae54ad7873f36696cd" url: "https://pub.dev" source: hosted - version: "0.12.19" + version: "0.12.20" material_color_utilities: dependency: transitive description: @@ -869,10 +869,10 @@ packages: dependency: transitive description: name: meta - sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" + sha256: "307249ce4ff29d58a18e97f6345f539382eb9c9c29ecda628900f31de0443dd9" url: "https://pub.dev" source: hosted - version: "1.18.0" + version: "1.19.0" mime: dependency: transitive description: @@ -1218,10 +1218,10 @@ packages: dependency: transitive description: name: test_api - sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" + sha256: "2a122cbe059f8b610d3a5415f42e255b6c17b1f21eee1d960f31080237fb4f11" url: "https://pub.dev" source: hosted - version: "0.7.11" + version: "0.7.12" timezone: dependency: transitive description: @@ -1354,10 +1354,10 @@ packages: dependency: transitive description: name: vector_math - sha256: d530bd74fea330e6e364cda7a85019c434070188383e1cd8d9777ee586914c5b + sha256: fa49e1674cb84acb900141714e6c6e1f9ae099827c24d141430ff6819db4e1bc url: "https://pub.dev" source: hosted - version: "2.2.0" + version: "2.4.4" visibility_detector: dependency: "direct main" description: