今天在学习使用轮播图Banner中发现些许问题,记录一下:
(1) 在加载插件flutter_swiper时,加载许久却没成功,可能是网络的原因。在windows下的解决方法:在用户变量下新增
变量名:PUB_HOSTED_URL 值:https://pub.flutter-io.cn
变量名:FLUTTER_STORAGE_BASE_URL 值:https://storage.flutter-io.cn
(2) 之后导入后出现了这样的问题:The library 'package:flutter_swiper/flutter_swiper.dart' is legacy, and should not be imported into a null safe library.
Try migrating the imported library
使用了命令:flutter run --no-sound-null-safety来运行。