早上好,我正在尝试在主页上放置一个 Carousel 以查找 Firebase 数据,但由于某种原因,当我第一次加载应用程序时,它会显示以下消息:
???????? Exception caught by widgets library ????????????????????????????????????? ??????????????????
The following _CastError was thrown building DotsIndicator (animation: PageController # 734f9 (one client, offset 0.0), dirty, state: _AnimatedState # 636ca):
Null check operator used on a null value
Run Code Online (Sandbox Code Playgroud)
屏幕看起来像这样:
进行热重载后,错误继续出现,但图像已成功加载,我可以做些什么提示?
家庭经理:
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provantagens_app/models/section.dart';
class HomeManager extends ChangeNotifier{
HomeManager({this.images}){
_loadSections();
images = images ?? [];
}
void addSection(Section section){
_editingSections.add(section);
notifyListeners();
}
final List<dynamic> _sections = [];
List<String> images;
List<dynamic> newImages;
List<dynamic> …Run Code Online (Sandbox Code Playgroud)