это мой pubspe c .yaml файл
flutter:
# The following line ensures that the Material Icons font is
# included with your application so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/m1.jpg
- assets/m2.jpg
- assets/m3.jpg
- assets/m4.jpg
- assets/cat/m13.jpg
выше изображения работают, кроме этого изображения
- assets/cat/m13.jpg
Я не получаю ошибки в pubspe c. файл yaml, и запуск «flutter packages get» дает код завершения 0.
В HorizontalListView.dart у меня есть следующий класс
class _HorizontalListViewState extends State<HorizontalListView> {
@override
Widget build(BuildContext context) {
return Container(
height: 80.0,
child: ListView(
scrollDirection: Axis.horizontal,
children: <Widget>[
Category(
image_location: " assets/cat/m13.jpg",
image_caption: "shirts",
),
],
),
);
}
}
Ошибка, с которой я столкнулся,
The following assertion was thrown resolving an image codec:
I/flutter (17029): Unable to load asset: assets/cat/m13.jpg
I/flutter (17029):
I/flutter (17029): When the exception was thrown, this was the stack:
I/flutter (17029): #0 PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:221:7)
I/flutter (17029): <asynchronous suspension>
I/flutter (17029): #1 AssetBundleImageProvider._loadAsync (package:flutter/src/painting/image_provider.dart:484:44)
I/flutter (17029): #2 AssetBundleImageProvider.load (package:flutter/src/painting/image_provider.dart:469:14)
I/flutter (17029): #3 ImageProvider.resolve.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:flutter/src/painting/image_provider.dart:327:17)
I/flutter (17029): #4 ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:160:22)
I/flutter (17029): #5 ImageProvider.resolve.<anonymous closure>.<anonymous closure> (package:flutter/src/painting/image_provider.dart:325:84)
I/flutter (17029): (elided 13 frames from package dart:async)
I/flutter (17029):
I/flutter (17029): Image provider: AssetImage(bundle: null, name: " assets/cat/m13.jpg")
I/flutter (17029): Image key: AssetBundleImageKey(bundle: PlatformAssetBundle#5adcb(), name: " assets/cat/m13.jpg",
Заранее спасибо