【发布时间】:2018-10-28 19:28:48
【问题描述】:
我需要为我的应用添加不断变化的背景。给我一个解决方案
代码:
Widget testBGCarousel = new Container(
child: new Carousel(
children: [
new AssetImage('images/a.jpg'),
new AssetImage('images/b.jpg'),
new AssetImage('images/sc.jpg'),
].map((bgImg) => new Image(image: bgImg, width: 1500.0, height: 1500.0,
fit: BoxFit.cover)).toList(),
displayDuration: const Duration(seconds: 4),
),
);
pubspec.yaml :
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.0
share: ^0.5.3
flutter_webview_plugin: ^0.2.1+2
launch_review: ^1.0.1
carousel: ^0.1.0
错误:
当前的 Dart SDK 版本是 2.1.0-dev.5.0.flutter-a2eb050044。
因为 carousel 0.1.0 需要 SDK 版本 0.1.0
发布失败 (1) 退出代码 1
【问题讨论】:
标签: android ios dart flutter carousel