Skip to content

perf: skip empty Cupertino prefix/suffix rows - #106

Open
palmoni5 wants to merge 1 commit into
ubuntu-flutter-community:mainfrom
palmoni5:perf/cupertino-adornment-layout
Open

palmoni5 wants to merge 1 commit into
ubuntu-flutter-community:mainfrom
palmoni5:perf/cupertino-adornment-layout

Conversation

@palmoni5

Copy link
Copy Markdown

Problem

CupertinoSpinBox always passed Row widgets as prefix/suffix, even when they were empty (buttons hidden, or vertical layout).

Fix

Build the Row only when horizontal buttons need reserved space; otherwise pass the caller's prefix/suffix, or null. Geometry is unchanged in all button modes, LTR and RTL.

Tests

test/cupertino_spinbox_layout_test.dart.

CI on main currently fails in the Android example build and the publish dry-run; it goes green with #102.

CupertinoSpinBox always passed a Row as the text field's prefix and
suffix, even when it was empty (buttons hidden or vertical layout and no
custom prefix/suffix). CupertinoTextField then built and laid out the
adornment slots for nothing.

Build the Row only when horizontal buttons need reserved space;
otherwise pass the caller's prefix/suffix (or null) directly.
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