Failed to find definition for url(#pattern0) : Flutter 2.8.1

After upgrade flutter with null safe i'm facing this error

            'assets/images/bg111.svg',
            height: MediaQuery.of(context).size.height,
            width: MediaQuery.of(context).size.width,
          ),```

Error:
════════ Exception caught by SVG ═══════════════════════════════════════════════
The following assertion was thrown while parsing AssetBundlePictureKey(bundle: PlatformAssetBundle#0293d(), name: "assets/images/bg111.svg", colorFilter: null) in _getDefinitionPaint:
Failed to find definition for url(#pattern0)

This occurs because you are using the element before defining it. For me the solution was moving the entire defs tag and its content to immediately after the opening svg tag