Skip to content

feat: migrate dragon_charts_flutter to monorepo packages#164

Merged
CharlVS merged 3 commits intodevfrom
migrate/dragon_charts_flutter
Aug 13, 2025
Merged

feat: migrate dragon_charts_flutter to monorepo packages#164
CharlVS merged 3 commits intodevfrom
migrate/dragon_charts_flutter

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Jul 30, 2025

This PR migrates the dragon_charts_flutter repository to the packages folder of the monorepo.

Changes

Package Details

  • Name: dragon_charts_flutter
  • Version: 0.1.1-dev.1
  • Description: A lightweight and highly customizable charting library for Flutter
  • Location: packages/dragon_charts/

Migration Method

  • Used git subtree add --squash to preserve history
  • Clean merge commit created
  • All original files and structure maintained

The package is now ready to be integrated into the monorepo workflow.

CharlVS added 2 commits July 30, 2025 18:20
git-subtree-dir: packages/dragon_charts
git-subtree-split: 3b667aab45cb1353e902c6b314c0e4ff19fb9022
Copilot AI review requested due to automatic review settings July 30, 2025 16:34
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 30, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch migrate/dragon_charts_flutter

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
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 migrates the dragon_charts_flutter repository to the monorepo packages structure while preserving complete git history. The package provides a lightweight and highly customizable charting library for Flutter with features including animated line charts, sparkline charts, interactive tooltips, and multiple chart visualization options.

Key Changes:

  • Migrated complete dragon_charts_flutter codebase from standalone repository to packages/dragon_charts/
  • Preserved original package structure and functionality including LineChart, SparklineChart, and supporting components
  • Maintained comprehensive test suite and example application across multiple platforms

Reviewed Changes

Copilot reviewed 110 out of 151 changed files in this pull request and generated no comments.

File Description
packages/dragon_charts/pubspec.yaml Package configuration with dependencies and metadata
packages/dragon_charts/lib/ Core library implementation including chart components, data structures, and selection strategies
packages/dragon_charts/test/ Comprehensive test suite covering all major chart components
packages/dragon_charts/example/ Multi-platform example application demonstrating chart functionality
Files not reviewed (3)
  • packages/dragon_charts/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported
  • packages/dragon_charts/example/ios/Runner.xcworkspace/contents.xcworkspacedata: Language not supported
  • packages/dragon_charts/example/macos/Runner.xcworkspace/contents.xcworkspacedata: Language not supported
Comments suppressed due to low confidence (3)

packages/dragon_charts/test/dragon_charts_flutter.dart:3

  • This test file contains only an empty placeholder test. The test should either be implemented with actual functionality testing or removed if not needed.
void main() {

packages/dragon_charts/test/dragon_charts_flutter.dart:4

  • The test description 'adds one to input values' does not match the dragon_charts_flutter package functionality. This appears to be placeholder test code that should be updated or removed.
  test('adds one to input values', () {

packages/dragon_charts/lib/src/line_chart.dart:46

  • Potential division by zero error if the data list is empty. The code should check if data.isEmpty before performing the reduce operation and division.
/// LineChart(

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bugbot free trial expires on August 9, 2025
Learn more in the Cursor dashboard.

// Timer to periodically update chart data
Timer.periodic(const Duration(seconds: 5), (timer) {
// add(ChartUpdated());
if (Random().nextBool() || true) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Random Check Overridden by True

The if (Random().nextBool() || true) condition always evaluates to true due to the || true clause. This renders the Random().nextBool() check ineffective, causing the chart data point count to always change instead of randomly. This appears to be debug code accidentally left in.

Locations (1)
Fix in Cursor Fix in Web

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@cursoragent please fix

Copy link
Copy Markdown

@cursor cursor bot Aug 9, 2025

Choose a reason for hiding this comment

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

Open in Cursor Open in Web

Learn more about Cursor Agents

final double dx = size.width / (data.length - 1);
final double minValue = data.reduce((a, b) => a < b ? a : b);
final double maxValue = data.reduce((a, b) => a > b ? a : b);
final double scaleY = size.height / (maxValue - minValue);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: SparklineChart Fails on Empty Data

The SparklineChart crashes with a StateError when an empty data list is provided. This is because data.reduce() is called on an empty collection in the constructor (for average calculation) and the paint method (for min/max value calculation).

Locations (1)
Fix in Cursor Fix in Web

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@cursor regen

Copy link
Copy Markdown

@cursor cursor bot Aug 7, 2025

Choose a reason for hiding this comment

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

I enhanced the SparklineChart to robustly handle edge cases like empty, single, or uniform data sets, preventing crashes and improving rendering. I also added comprehensive widget tests to validate these new behaviors.

  • I modified the _CustomSparklinePainter constructor in packages/dragon_charts/lib/src/sparkline/sparkline_chart.dart to safely calculate average by checking for empty data, setting it to 0 to prevent division by zero errors.
  • I updated the paint method within _CustomSparklinePainter to gracefully handle edge cases:
    • It now returns early if data is empty.
    • It draws a horizontal line for single data points or when all data values are identical, ensuring a visual representation instead of an error.
  • I added a new test file, packages/dragon_charts/test/sparkline_chart_test.dart, implementing testWidgets to verify the SparklineChart's stability and correct behavior across various scenarios, including empty, single-point, and uniform data sets.

Open in Cursor Open in Web

Learn more about Cursor Agents

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 30, 2025

Visit the preview URL for this PR (updated for commit b52b4d5):

https://komodo-defi-sdk--pr164-migrate-dragon-chart-5sn0xvfv.web.app

(expires Thu, 14 Aug 2025 15:08:28 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 7f9f5ac39928f333b6e8fcefb7138575e24ed347

Co-authored-by: charl <charl@vanstaden.info>
@CharlVS CharlVS merged commit 260c8fc into dev Aug 13, 2025
6 of 7 checks passed
@CharlVS CharlVS deleted the migrate/dragon_charts_flutter branch August 13, 2025 16:13
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.

3 participants