在flutter

时间:2018-06-14 12:13:42

标签: flutter

我想在后台设置图像,我在项目名称下创建了一个assets文件夹并将图像粘贴到其中,然后我写下了代码。但它显示这样的错误,

I/flutter (13556): 
I/flutter (13556): When the exception was thrown, this was the stack:
I/flutter (13556): #0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
I/flutter (13556): <asynchronous suspension>
I/flutter (13556): #1      AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:383:44)
I/flutter (13556): <asynchronous suspension>
I/flutter (13556): #2      AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:368:14)
I/flutter (13556): #3      ImageProvider.resolve.<anonymous closure>.<anon`enter code here`ymous closure> (package:flutter/src/painting/image_provider.dart:265:86)
I/flutter (13556): #4      ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:82:22)
I/flutter (13556): #5      ImageProvider.resolve.<anonymous closure> (package:flutter/src/painting/image_provider.dart:265:63)
I/flutter (13556): (elided 8 frames from package dart:async)
I/flutter (13556): 
I/flutter (13556): Image provider: AssetImage(bundle: null, name: "assets/app_icon.png")
I/flutter (13556): Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#3950b(), name: "assets/app_icon.png",
I/flutter (13556): scale: 1.0)
@override
  Widget build(BuildContext context) {
    return new Scaffold(
      body: new Container(
        decoration: new BoxDecoration(
          image: new DecorationImage(
            image: new AssetImage("assets/app_icon.png"),
            fit: BoxFit.cover,
          ),
        ),
        child: null /* add child content content here */,
      ),
    );
  }

1 个答案:

答案 0 :(得分:1)

在pubspec.yaml中检查“标签”。

应该在“ flutter:”的一级标签中,即与“ uses-material-design:true”说的相同级别

undefined

success: function (encoded, status, xhr, $form) {
    decoded = JSON.parse(encoded)
    if (decoded.status === 'success') {