Skip to content

Conversation

@ryanaidilp
Copy link
Owner

@ryanaidilp ryanaidilp commented Oct 24, 2025

Summary

  • Add RelatedPublication entity with id, title, releaseDate, url, and cover fields
  • Add RelatedPublicationModel for JSON serialization/deserialization
  • Update Publication entity to include relatedPublications list field
  • Update PublicationModel to parse related field from API response
  • Add comprehensive unit tests for related publications feature
  • Export RelatedPublication in SDK main library
  • Add UI components in example app to display related publications

Changes

SDK Changes

New Files

  • lib/src/features/publications/domain/entities/related_publication.dart - Entity for related publications
  • lib/src/features/publications/data/models/related_publication_model.dart - Model for JSON mapping

Modified Files

  • lib/src/features/publications/domain/entities/publication.dart - Added relatedPublications field
  • lib/src/features/publications/data/models/publication_model.dart - Added JSON parsing for related field
  • lib/stadata_flutter_sdk.dart - Exported RelatedPublication entity
  • test/src/features/publications/data/models/publication_model_test.dart - Added 5 new comprehensive tests

Example App Changes

New Files

  • app/example/lib/features/publications/presentation/widgets/related_publications_widget.dart - Widget to display related publications list

Modified Files

  • app/example/lib/features/publications/presentation/widgets/publication_detail_content.dart - Added related publications section

Features

UI Components

RelatedPublicationsWidget

  • Displays list of related publications in a card layout
  • Uses ListView.separated for clean item separation
  • Shows section title "Related Publications"

RelatedPublicationItem

  • Individual publication item with cover image (60x80)
  • Publication title (max 2 lines with ellipsis)
  • Release date in DD/MM/YYYY format
  • Tappable with navigation arrow icon
  • Loading and error states for cover images

Test Coverage

All tests pass successfully:

  • ✅ fromEntity preserves relatedPublications
  • ✅ fromJson correctly parses related publications
  • ✅ fromJson handles missing related field
  • ✅ toJson includes related publications
  • ✅ copyWith updates relatedPublications
  • ✅ All 18 publication feature tests pass

Screenshots

The example app now displays related publications at the bottom of the publication detail page, showing cover images, titles, and release dates for each related publication.

- Create RelatedPublication entity with id, title, releaseDate, url, and cover
- Create RelatedPublicationModel for JSON serialization
- Update Publication entity to include relatedPublications list
- Update PublicationModel to parse 'related' field from API response
- Add proper JSON mapping with fromJson, toJson, and fromEntity methods
- All tests pass successfully
- Test fromEntity preserves relatedPublications
- Test fromJson correctly parses related publications
- Test fromJson handles missing related field
- Test toJson includes related publications
- Test copyWith updates relatedPublications
- All 6 tests pass successfully
@github-actions
Copy link

github-actions bot commented Oct 24, 2025

📊 Test Coverage Report

🎯 Coverage: 74.9%

Metric Value
Total Lines 2665
Lines Hit 1997
Coverage 74.9%
Minimum Required 80.0%

⚠️ Coverage is below the minimum requirement of 80%

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

🎯 CI Summary

🧪 Core SDK testing (critical components changed)

Check Status
✅ Semantic PR ✅ Passed
📝 Spell Check ⏭️ Skipped
🧪 Build & Test ✅ Passed

✅ All checks passed!

This PR is ready for review.

@github-actions
Copy link

github-actions bot commented Oct 24, 2025

📱 APK Build Complete

APK successfully built for this PR!

📋 Build Details

📥 Download APK

Method 1: Direct Download (Recommended)

  1. Click on the Build Run Link above
  2. Scroll down to the "Artifacts" section
  3. Click on stadata-example-pr-143-e2cb28e to download

Method 2: GitHub CLI (if you have it installed)

gh run download 18774561099 --repo ryanaidilp/stadata_flutter_sdk --name stadata-example-pr-143-e2cb28e

📝 APK Info

📊 Size Analysis

📈 Detailed APK Size Analysis (click to expand)

APK Size Analysis Report

Generated: Fri Oct 24 08:50:09 UTC 2025

APK File: Stadata_Example_PR-143_e2cb28e.apk
Total Size: 24M (24468032 bytes)

📊 Size Breakdown by Category

📚 Stadata Flutter SDK Contribution

The SDK package was not found as a separate entry in the size analysis. This could mean:

  1. The SDK code size is very small (< 1% threshold)
  2. The SDK code has been merged with other Dart code
  3. The size analysis is using a different package naming

Estimated SDK footprint: ~200-400 KB of Dart code

💡 Size Optimization Recommendations

Already Applied ✅

  1. R8/ProGuard enabled - Code shrinking and obfuscation active
  2. Resource shrinking enabled - Unused resources removed
  3. ABI splits configured - Architecture-specific APKs
  4. Release build - Optimized production build

Additional Optimizations

  1. Use App Bundles (AAB)

    • Upload AAB to Play Store instead of APK
    • Google Play generates optimized APKs per device
    • Typical size reduction: 20-30%
  2. Lazy Loading

    • Use deferred imports for rarely-used features
    • Reduces initial download size
  3. Image Optimization

    • Use WebP format instead of PNG/JPG
    • Compress images before bundling
    • Use vector graphics where possible
  4. Remove Unused Dependencies

    • Audit pubspec.yaml for unused packages
    • Each dependency adds to APK size

📈 Analysis Summary

Component Size % of Total
Total APK 24M 100%

Generated by APK Size Analysis Script using Flutter's --analyze-size output
Raw data: size_analysis_pr_e2cb28e.json

🚀 Installation

  1. Download the APK file
  2. Enable "Install from Unknown Sources" in your Android settings
  3. Install the APK on your Android device
  4. Test the latest changes from this PR

🤖 This comment is automatically updated when new commits are pushed to this PR.

- Export RelatedPublication entity in SDK main library
- Create RelatedPublicationsWidget to display list of related publications
- Create RelatedPublicationItem widget for individual publication items
- Update PublicationDetailContent to show related publications section
- Display related publications with cover image, title, and release date
- Add navigation placeholder for related publication items
@ryanaidilp ryanaidilp self-assigned this Oct 24, 2025
@ryanaidilp ryanaidilp merged commit 3828ef2 into develop Oct 24, 2025
9 checks passed
@ryanaidilp ryanaidilp deleted the feature/publication-related-publications branch October 24, 2025 08:56
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.

2 participants