Repository navigation
Commit d2e97da
authored
[material_ui] Add Checkbox.markInsets (flutter#12690)
This PR ports my changes from flutter#188258 to
flutter/packages,
as part of flutter#188444
Adds `Checkbox.markInsets` and `CheckboxThemeData.markInsets`, which inset the check
mark and the
indeterminate dash within the checkbox without changing the size of the box itself. The
mark and its
stroke shrink proportionally, and the mark is not painted if the insets leave no room.
Fixes flutter#188031
## Tests
Added to `packages/material_ui/test/checkbox_test.dart`:
- `Checkbox.markInsets` defaults to null
- Checkbox with no `markInsets` paints the check at full stroke width (backward-compat)
- `Checkbox.markInsets` shrinks the check mark and its stroke
- `Checkbox.markInsets` shrinks the indeterminate dash
- `Checkbox.markInsets` larger than the box collapses the mark without crashing
- `Checkbox.markInsets` falls back to `CheckboxThemeData.markInsets`
- `Checkbox.markInsets` overrides `CheckboxThemeData.markInsets`
## Pre-Review Checklist
submitting PRs.
am not using AI tools.
brackets, e.g. `[shared_preferences]`
and the [repository CHANGELOG style], or I have commented below to indicate which
documented exception this PR falls under[^1].
indicate which [test exemption] this PR falls under[^1].
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 parent e71b3fd commit d2e97da
5 files changed
Lines changed: 319 additions & 10 deletions
File tree
- packages/material_ui
- lib/src
- pending_changelogs
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | 122 | | |
| |||
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
132 | | - | |
133 | | - | |
134 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| 160 | + | |
158 | 161 | | |
159 | 162 | | |
160 | 163 | | |
| |||
406 | 409 | | |
407 | 410 | | |
408 | 411 | | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
409 | 437 | | |
410 | 438 | | |
411 | 439 | | |
| |||
617 | 645 | | |
618 | 646 | | |
619 | 647 | | |
| 648 | + | |
| 649 | + | |
620 | 650 | | |
621 | 651 | | |
622 | 652 | | |
| |||
646 | 676 | | |
647 | 677 | | |
648 | 678 | | |
| 679 | + | |
649 | 680 | | |
650 | 681 | | |
651 | 682 | | |
| |||
696 | 727 | | |
697 | 728 | | |
698 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
699 | 741 | | |
700 | 742 | | |
701 | 743 | | |
| |||
741 | 783 | | |
742 | 784 | | |
743 | 785 | | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
744 | 807 | | |
745 | 808 | | |
746 | 809 | | |
| |||
756 | 819 | | |
757 | 820 | | |
758 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
759 | 829 | | |
760 | | - | |
761 | | - | |
762 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
763 | 834 | | |
764 | 835 | | |
765 | 836 | | |
| |||
779 | 850 | | |
780 | 851 | | |
781 | 852 | | |
782 | | - | |
783 | | - | |
784 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
785 | 863 | | |
786 | 864 | | |
787 | 865 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
| |||
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| 121 | + | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| |||
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
| 133 | + | |
128 | 134 | | |
129 | 135 | | |
130 | 136 | | |
| |||
150 | 156 | | |
151 | 157 | | |
152 | 158 | | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| |||
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
| 174 | + | |
167 | 175 | | |
168 | 176 | | |
169 | 177 | | |
| |||
183 | 191 | | |
184 | 192 | | |
185 | 193 | | |
186 | | - | |
| 194 | + | |
| 195 | + | |
187 | 196 | | |
188 | 197 | | |
189 | 198 | | |
| |||
226 | 235 | | |
227 | 236 | | |
228 | 237 | | |
| 238 | + | |
229 | 239 | | |
230 | 240 | | |
231 | 241 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments