Repository navigation
Commit d420480
committed
Improve Container color/decoration error message clarity
The previous assertion message was confusing because it stated
'Cannot provide both' but then suggested 'To provide both, use...',
which contradicted the restriction. This confused developers about
the actual requirement.
Updated the message to clearly explain:
- The color parameter is a shorthand for decoration: BoxDecoration(color: color)
- Developers should use either color OR decoration, not both
- To use both color and other decoration properties, set the color
within BoxDecoration
Also added a test to verify the assertion triggers with the new
message when both parameters are provided.
Fixes flutter#1194841 parent 17e65b6 commit d420480
2 files changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
279 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
280 | 281 | | |
281 | 282 | | |
282 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
782 | 802 | | |
783 | 803 | | |
784 | 804 | | |
| |||
0 commit comments