小编Nic*_*ima的帖子

空值检查运算符用于空值 Carousel Flutter

早上好,我正在尝试在主页上放置一个 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)

carousel flutter

4
推荐指数
1
解决办法
7201
查看次数

标签 统计

carousel ×1

flutter ×1