Skip to content

refactor: delete all deprecated attributes#176

Merged
koukibadr merged 1 commit into
mainfrom
refactor/remove-all-deprecated-attributes
Jul 6, 2026
Merged

refactor: delete all deprecated attributes#176
koukibadr merged 1 commit into
mainfrom
refactor/remove-all-deprecated-attributes

Conversation

@koukibadr

@koukibadr koukibadr commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added a new demo screen showcasing multiple picker modes and configurations.
  • Enhancements

    • Improved search filtering for picker items.
    • Added support for more flexible result handling when selections are cleared or unavailable.
    • Exposed the currently selected value(s) for easier integration.
  • Bug Fixes

    • Refined date selection behavior to better respect allowed calendar days.
    • Simplified picker headers and removed the separate close button area.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@koukibadr, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 3 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c016fcfb-850a-4db4-b59c-bc441b672cb1

📥 Commits

Reviewing files that changed from the base of the PR and between 1e7ea33 and fac757e.

📒 Files selected for processing (7)
  • analysis_options.yaml
  • example/lib/example_widget.dart
  • example/lib/main.dart
  • lib/bottom_picker.dart
  • lib/widgets/close_icon.dart
  • lib/widgets/year_picker.dart
  • test/simple_bottom_picker_test.dart
📝 Walkthrough

Walkthrough

This PR refactors BottomPicker: adds a SearchItemPredicate<T> typedef, widens callbacks to nullable types, removes header title/close-icon support, moves selected values into widget-owned fields with new getters, adds calendar-day filtering, removes CloseIcon widget, extracts the example app into a new file, updates a test, and adjusts lint exclusions.

Changes

BottomPicker API refactor and example demo

Layer / File(s) Summary
Search predicate typedef and nullable callbacks
lib/bottom_picker.dart
Adds SearchItemPredicate<T> typedef, widens onSubmit/onDismiss/range callbacks to nullable types, adds pickerTextStyle wiring across constructors, removes non-null assertions.
Header/close-icon removal
lib/bottom_picker.dart, lib/widgets/close_icon.dart
Removes pickerTitle/pickerDescription/close-icon properties, simplifies header rendering to headerBuilder only, deletes the CloseIcon widget.
Widget-owned selected state and getters
lib/bottom_picker.dart, lib/widgets/year_picker.dart
Adds currentValue/currentFirstDateTime/currentSecondDateTime getters, refactors initState/dispose, adds static of<T>(), moves selection state to widget fields, adds calendarDays filtering, updates year_picker.dart to pass raw list to SimplePicker.
Test and config updates
test/simple_bottom_picker_test.dart, analysis_options.yaml
Guards test onSubmit callback against null, adjusts analyzer exclude list.
Example app extraction
example/lib/example_widget.dart, example/lib/main.dart
Extracts ExampleApp widget into its own file demonstrating all picker variants; updates main.dart imports.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

  • koukibadr/Bottom-Picker#172: Both PRs refactor lib/bottom_picker.dart by removing deprecated header/close-icon-related constructor parameters and related API wiring.
  • koukibadr/Bottom-Picker#173: Both PRs modify the search/filter API and generic typing in lib/bottom_picker.dart.

Poem

A rabbit hops through headers old,
Close icons gone, new getters bold 🐇
Selected dates now live with pride,
Nullable callbacks by my side,
Example widgets, fresh and new—
Thump thump, this refactor's true! 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: removing deprecated picker attributes and related API cleanup.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/bottom_picker.dart`:
- Around line 775-785: The currentValue getter in bottom_picker.dart falls back
to _selectedDateTime for range picker types, but rangeDate and rangeTime use
_selectedFirstDateTime and _selectedSecondDateTime instead. Update currentValue
to explicitly handle the range picker cases in BottomPickerType so it does not
return an unset field, either by returning an appropriate range value or by
preventing currentValue from being used for range flows; also make sure any
existing getters like currentFirstDateTime and currentSecondDateTime are the
intended accessors for range pickers.
- Around line 803-808: The _selectedItemIndex, _selectedItem, _selectedDateTime,
_selectedTimerDuration, _selectedSecondDateTime, and _selectedFirstDateTime
fields are mutable runtime selection state and should live in BottomPickerState
rather than BottomPicker. Move the selection tracking into the state class and
update the relevant selection handlers in BottomPickerState so currentValue and
submit callbacks read from state instead of widget fields. Remove any writing
back into widget and make sure the state persists across rebuilds so selections
do not reset when BottomPicker is recreated.
- Around line 1046-1051: The selected-date update logic in
CupertinoDatePickerWidget is filtering calendarDays twice, which can leave
_selectedDateTime out of sync with the visible wheel state; remove the early
return in the date assignment path and rely on the widget’s existing
calendarDays enforcement/snapping behavior instead. Keep the update in the code
path that assigns widget._selectedDateTime so the picker always tracks the
displayed date, and use the existing DateTime.weekday mapping directly since it
already matches fullWeek.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 255dceec-e75a-48ca-9f63-b725625e9a32

📥 Commits

Reviewing files that changed from the base of the PR and between 043a1f2 and 1e7ea33.

📒 Files selected for processing (7)
  • analysis_options.yaml
  • example/lib/example_widget.dart
  • example/lib/main.dart
  • lib/bottom_picker.dart
  • lib/widgets/close_icon.dart
  • lib/widgets/year_picker.dart
  • test/simple_bottom_picker_test.dart
💤 Files with no reviewable changes (1)
  • lib/widgets/close_icon.dart

Comment thread lib/bottom_picker.dart Outdated
Comment thread lib/bottom_picker.dart Outdated
Comment thread lib/bottom_picker.dart Outdated
@koukibadr koukibadr force-pushed the refactor/remove-all-deprecated-attributes branch from 1e7ea33 to fac757e Compare July 6, 2026 11:52
@koukibadr koukibadr merged commit 31845d0 into main Jul 6, 2026
5 checks passed
@koukibadr koukibadr deleted the refactor/remove-all-deprecated-attributes branch July 6, 2026 11:55
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.

1 participant