1. The decoration properties

The Decoration property of the Container allows you to set the border, background color, background image, and rounded corners. For the transform property, those who have experience in the development of other platforms generally understand that the transform is not the actual position of the transform, but the drawing effect of the transform. That is to say, its click, size, spacing, etc., are all in accordance with before the transform.

Note: Deoration and color (background color) cannot coexist, only one of the two can exist at the same time

Examples of errors:

Error as follows:

I/flutter (19296): Cannot provide both a color and a decoration   
I/flutter (19296): The color argument is just a shorthand for "decoration: new BoxDecoration(color: color)".
I/flutter (19296): 'package:flutter/src/widgets/container.dart':        
I/flutter (19296): Failed assertion: line 271 pos 15: 'color == null || decoration == null'
Copy the code

Solution: Do one or the other


2. An error occurs when loading image resources

Error while loading local resources:

EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE 

The following assertion was thrown resolving an image codec:
Copy the code

As shown in figure

I instinctively thought that there was a mistake in the name of the image resource, which led to the loading failure. However, I checked several times and found that there was no mistake.

Picture catalogue:

Resource Documents:

It turns out that the problem was actually in the.yaml file, and the correct way to write assests is to roll it back and align it with “uses-material-design: true”!

Correct way to write:

Ps: About the load error of the flutter network image: The load error of the flutter network image