Skip to content

Conversation

@rolandgeider
Copy link
Member

Proposed Changes

Shows user earned trophies

Simulator Screenshot - iPhone 17 Pro - 2025-12-20 at 21 29 39 Simulator Screenshot - iPhone 17 Pro - 2025-12-20 at 21 29 42

Related Issue(s)

Closes #994

@rolandgeider rolandgeider force-pushed the feature/trophies branch 2 times, most recently from 97ec78f to 4563c58 Compare January 10, 2026 15:16
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a trophies feature to display user-earned trophies for workout achievements. The implementation includes trophy models, a repository for fetching trophy data, UI widgets to display trophies on the dashboard and in a dedicated screen, and integration with workout logs to show personal record indicators.

Changes:

  • Added trophy data models (Trophy, UserTrophy, UserTrophyProgression, ContextData) with JSON serialization
  • Implemented TrophyRepository and TrophyStateNotifier using Riverpod for state management
  • Created UI widgets for displaying trophies on the dashboard and in a dedicated trophies screen
  • Integrated trophy indicators with workout logs to highlight personal records

Reviewed changes

Copilot reviewed 55 out of 55 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/models/trophies/*.dart Trophy domain models with JSON serialization
lib/providers/trophies.dart Trophy repository and state management using Riverpod
lib/widgets/trophies/*.dart Trophy UI components for overview and dashboard
lib/widgets/dashboard/widgets/trophies.dart Dashboard widget showing recent trophies
lib/widgets/routines/logs/*.dart Integration of trophy/PR indicators in workout logs
lib/screens/trophy_screen.dart Dedicated screen for viewing all trophies
lib/providers/base_provider.dart Added language parameter support to fetch methods
lib/main.dart Integrated Riverpod providers with existing Provider-based architecture
test/trophies/*.dart Unit and widget tests for trophy functionality
Comments suppressed due to low confidence (2)

lib/providers/base_provider.dart:68

  • The language parameter is accepted but never passed to getDefaultHeaders(). The language should be passed as getDefaultHeaders(includeAuth: true, language: language) to include the Accept-Language header in the request.
  Future<dynamic> fetch(Uri uri, {String? language}) async {
    // Send the request
    final response = await client.get(
      uri,
      headers: getDefaultHeaders(includeAuth: true),
    );

lib/widgets/routines/logs/exercises_expansion_card.dart:84

  • The null assertion operator ! is used twice. Consider using a single null-safe access pattern like topSet?.weightUnitObj?.name with proper null handling to improve code clarity.
    final topSetWeightUnit = topSet?.weightUnitObj != null
        ? getServerStringTranslation(topSet!.weightUnitObj!.name, context)
        : '';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Conflicts:
#	lib/providers/base_provider.dart
#	lib/providers/gym_state.dart
#	lib/providers/gym_state.g.dart
#	lib/widgets/routines/gym_mode/log_page.dart
#	test/core/settings_test.mocks.dart
#	test/exercises/contribute_exercise_image_test.mocks.dart
#	test/gallery/gallery_form_test.mocks.dart
#	test/gallery/gallery_screen_test.mocks.dart
#	test/measurements/measurement_provider_test.mocks.dart
#	test/nutrition/nutritional_plan_screen_test.mocks.dart
#	test/nutrition/nutritional_plans_screen_test.mocks.dart
#	test/routine/gym_mode/gym_mode_test.mocks.dart
#	test/routine/routine_screen_test.mocks.dart
#	test/routine/routines_provider_test.mocks.dart
#	test/routine/routines_screen_test.mocks.dart
#	test/user/provider_test.mocks.dart
#	test/weight/weight_provider_test.mocks.dart
#	test/widgets/routines/gym_mode/log_page_test.dart
# Conflicts:
#	lib/main.dart
#	lib/screens/dashboard.dart
@rolandgeider rolandgeider merged commit 9d9ea3b into master Jan 18, 2026
4 checks passed
@rolandgeider rolandgeider deleted the feature/trophies branch January 18, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement trophies

2 participants