Repository navigation
chore: clear ruflet_color_pickers analyzer issues - #75
Merged
AdamMusa merged 1 commit intoNov 2, 2026
Merged
Conversation
The package had 126 analyzer infos on the base and no errors or warnings: 98 deprecated_member_use and 28 lints. - Color.value becomes toARGB32(), which is what the getter returns. - Color.alpha/red/green/blue/opacity and withOpacity become the ColorChannels8 helpers, which compute the same 8-bit values from toARGB32() and keep withOpacity's 8-bit alpha (withValues would not). A test compares them with the deprecated getters. - SlidePicker showLabel becomes an empty labelTypes list, which the picker treats the same way. - labelTextStyle and sliderTextStyle stay on the deprecated API with a scoped ignore: their replacement is a Theme text-role override that cannot express a per-control style without changing rendering. - Lints: super parameters, braces, local names without underscores, and a growable list in the multiple-choice test where const would break the picker's in-place edits.
AdamMusa
force-pushed
the
chore/color-pickers-analyzer
branch
from
October 28, 2026 23:22
0ec86d6 to
50ae312
Compare
This was referenced Oct 29, 2026
AdamMusa
pushed a commit
that referenced
this pull request
Nov 2, 2026
Brings in the PRs merged since (#25-#75) so #76 merges cleanly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MqfxcsDiEUZngybe9L72JQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ruflet_color_pickershad 126flutter analyzeissues on the base. This PR fixes them without behavior changes; the package's tests still pass.Classification (base)
deprecated_member_use)Color.value×32,withOpacity×17,red/green/blue×13 each,opacity×3,alpha×3; flutter_colorpickerlabelTextStyle×2,sliderTextStyle×1,showLabel×1use_super_parameters×12,curly_braces_in_flow_control_structures×8,no_leading_underscores_for_local_identifiers×7,prefer_const_literals_to_create_immutables×1 (test)Most issues (97) are in
lib/src/cupertino_picker/, the local MIT fork of flutter_colorpicker 1.1.0. The rest are in the Ruflet wrapper renderers.Fixes
Color.value→toARGB32(). This is literally what the deprecated getter returns.alpha/red/green/blue/opacity/withOpacitymove to a small package extension,lib/src/utils/color_channels.dart. It providesalpha8,red8,green8,blue8,opacity8andwithOpacity8, computed exactly like the deprecated dart:ui getters: fromtoARGB32(), with 8-bit quantized alpha. I did not use the suggestedwithValues(alpha:), because it keeps the exact double and would subtly change the colors andColorequality that the pickers and their history depend on. The newtest/color_channels_test.dartcompares every helper against the deprecated getter, including non-8-bit float colors from HSV/HSL conversion and edge opacities.showLabel→labelTypes: show_label ? labelTypes : []. Upstream draws the label only whenshowLabel && labelTypes.isNotEmpty, so this is the same condition.labelTextStyle(ColorPicker, SlidePicker) andsliderTextStyle(SlidePicker). Upstream's replacement is to alterTheme.of(context).textThemeroles. That cannot reproduce Ruby's per-controllabel_text_style/slider_text_stylewithout changing rendering: the label font-size override, the slider text fallback to bodyLarge/bodyMedium, and the theme seen by surrounding widgets. The three call sites carry a scoped// ignore: deprecated_member_usewith that reason. A real migration would be a rendering change and deserves its own PR.dart fixfor super parameters and braces._xidentifiers incupertino_picker/material_picker.dart. The automated rename collided with an existingcolorvariable, so I picked non-colliding names.pickerColors: const [red]. The multiple-choice picker edits that list in place (the test failed with a const list), so the test now passesList.of([red])with a comment instead.Tests
flutter analyze: 126 → No issues found.flutter testin the package: 8 passed (7 existing + 1 new equivalence test).team/verify_pr.sh <engine> ""withEXT_PKGS=ruflet_color_pickersat head50ae312(rebased onb4d3f8e): PASSflutter test: +734, all passed;flutter analyze lib test: No issues foundflutter test: +8, all passed;flutter analyze lib test: No issues foundEngine-only change; rebased on the latest
codex/engine-initialization(b4d3f8e).