Skip to content

Conversation

ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Oct 4, 2025

Summary

  • Changed CHUNK_SIZE constant to chunkSize in Flutter SDK templates to follow Dart's lowerCamelCase naming convention
  • Resolves the constant_identifier_names lint warning

Why This Change is Needed

According to the Dart Style Guide, constants should use lowerCamelCase naming:

DO name constants using lowerCamelCase.

In new code, use lowerCamelCase for constant variables, including enum values.

The current CHUNK_SIZE constant uses SCREAMING_CAPS, which was an older convention. Modern Dart code should use chunkSize instead.

Files Changed

  • templates/flutter/lib/src/client.dart.twig
  • templates/flutter/lib/src/client_browser.dart.twig
  • templates/flutter/lib/src/client_io.dart.twig

Impact

This change affects the generated Flutter SDK and will eliminate the constant_identifier_names lint warnings in the generated code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Renamed public constant CHUNK_SIZE to chunkSize across Flutter client APIs (including browser and IO implementations).
    • This is a breaking change for consumers referencing the old constant name.
    • Update your code to use chunkSize to ensure compatibility.

Changed CHUNK_SIZE constant to chunkSize in Flutter templates to follow Dart's lowerCamelCase naming convention for constants, addressing the constant_identifier_names lint warning.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

coderabbitai bot commented Oct 4, 2025

Warning

Rate limit exceeded

@ChiragAgg5k has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 10 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 049b7c0 and 6a38a32.

📒 Files selected for processing (4)
  • templates/dart/lib/src/client.dart.twig (1 hunks)
  • templates/dart/lib/src/client_browser.dart.twig (3 hunks)
  • templates/dart/lib/src/client_io.dart.twig (4 hunks)
  • templates/flutter/lib/src/client.dart.twig (1 hunks)

Walkthrough

Public constant identifiers were renamed from CHUNK_SIZE to chunkSize across Flutter templates:

  • In templates/flutter/lib/src/client.dart.twig, Client’s static constant was renamed.
  • In templates/flutter/lib/src/client_browser.dart.twig, ClientBrowser’s static constant was renamed and all internal references updated.
  • In templates/flutter/lib/src/client_io.dart.twig, ClientIO’s static constant was renamed and all usages updated (size checks, offsets, end calculations, content-range). No control flow changes.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly captures the primary change of renaming the Flutter constant from CHUNK_SIZE to chunkSize, clearly reflecting the main objective of the pull request without unnecessary detail or ambiguity.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c30701f and 049b7c0.

📒 Files selected for processing (3)
  • templates/flutter/lib/src/client.dart.twig (1 hunks)
  • templates/flutter/lib/src/client_browser.dart.twig (3 hunks)
  • templates/flutter/lib/src/client_io.dart.twig (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: build (8.3, Python312)
  • GitHub Check: build (8.3, Ruby31)
  • GitHub Check: build (8.3, Android5Java17)
  • GitHub Check: build (8.3, WebChromium)
  • GitHub Check: build (8.3, AppleSwift56)
  • GitHub Check: build (8.3, WebNode)
  • GitHub Check: build (8.3, Python311)
  • GitHub Check: build (8.3, Swift56)
  • GitHub Check: build (8.3, Ruby27)
  • GitHub Check: build (8.3, Node20)
  • GitHub Check: build (8.3, KotlinJava17)
  • GitHub Check: build (8.3, Node18)
  • GitHub Check: build (8.3, KotlinJava8)
  • GitHub Check: build (8.3, Android14Java17)
  • GitHub Check: build (8.3, DotNet90)
  • GitHub Check: build (8.3, DotNet80)
  • GitHub Check: swift (server)
  • GitHub Check: kotlin (server)
  • GitHub Check: apple (client)
  • GitHub Check: android (client)
🔇 Additional comments (5)
templates/flutter/lib/src/client.dart.twig (1)

13-13: LGTM! Constant rename follows Dart conventions.

The renaming from CHUNK_SIZE to chunkSize correctly follows Dart's lowerCamelCase naming convention for constants, eliminating the constant_identifier_names lint warning.

Note: This is a breaking change for any code that directly references Client.CHUNK_SIZE. Users of the generated SDK will need to update to Client.chunkSize.

templates/flutter/lib/src/client_browser.dart.twig (2)

19-19: LGTM! Constant declaration updated consistently.

The constant declaration has been correctly renamed from CHUNK_SIZE to chunkSize, consistent with the parent Client class.


133-133: LGTM! All usages updated consistently.

All references to the constant in the chunkedUpload method have been correctly updated to use chunkSize:

  • Line 133: Size comparison for single-shot vs. chunked upload
  • Line 157: Resume offset calculation
  • Line 163: Chunk end index calculation
  • Line 171: Content-Range header calculation
  • Line 178: Offset advancement

The logic remains unchanged; only the identifier has been renamed.

Also applies to: 157-157, 163-163, 171-171, 178-178

templates/flutter/lib/src/client_io.dart.twig (2)

25-25: LGTM! Constant declaration updated consistently.

The constant declaration has been correctly renamed from CHUNK_SIZE to chunkSize, consistent with the parent Client class and the sibling ClientBrowser class.


247-247: LGTM! All usages updated consistently across both code paths.

All references to the constant in the chunkedUpload method have been correctly updated to use chunkSize:

  • Line 247: Size comparison for single-shot vs. chunked upload
  • Line 279: Resume offset calculation
  • Line 292: Chunk end index calculation (bytes path)
  • Line 296: Chunk read size (file path)
  • Line 304: Content-Range header calculation
  • Line 311: Offset advancement

Both code paths (file.bytes and file.path) have been updated consistently. The logic remains unchanged; only the identifier has been renamed.

Also applies to: 279-279, 292-292, 296-296, 304-304, 311-311

@abnegate abnegate merged commit ea7ebb0 into master Oct 6, 2025
52 checks passed
@abnegate abnegate deleted the fix-flutter-chunk-size-constant-naming branch October 6, 2025 03:17
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