簡體   English   中英

Flutter web:預期類型為“SkDeletable”的值,但得到的類型為“Null”

[英]Flutter web: Expected a value of type 'SkDeletable', but got one of type 'Null'

在 Flutter web 中出現此錯誤: Expected a value of type 'SkDeletable', but got one of type 'Null'的值。

它適用於: release mode但不適用於debug mode 有人知道這是從哪里來的嗎? 錯誤日志並沒有說明太多,除了導致它的小部件在哪里,這是CustomCard

這是我的代碼:

CustomCard(
              cardWidth: _cardWidth,
              cardHeight: _cardHeight,
              serviceIcon: servicesBackgrounds[3],
              serviceTitle: servicesTitles[3],
              serviceDescription: servicesDescriptions[3],
            ),

//-------------------------------------------- ----------------------------------//

final double _height = MediaQuery.of(context).size.height;
final double _width = MediaQuery.of(context).size.width;
Container(
    width: widget.cardWidth,
    height: widget.cardHeight,
    padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 12),
    child: Card(
      semanticContainer: true,
      clipBehavior: Clip.antiAliasWithSaveLayer,
      shape:
          RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
      elevation: 2,
      child: Container(
        decoration: BoxDecoration(
            image: DecorationImage(
                image: ExactAssetImage(widget.serviceIcon),
                fit: BoxFit.cover),
            color: darkBlue,
            borderRadius: BorderRadius.circular(10),
            boxShadow: isHover
                ? [
                    BoxShadow(
                        color: crimson,
                        blurRadius: 24.0,
                        offset: Offset(5.0, 15.0))
                  ]
                : []),
        child: BackdropFilter(
          filter: ImageFilter.blur(sigmaX: 0, sigmaY: 0),
          child: Container(
            decoration: BoxDecoration(color: darkBlue.withOpacity(0.8)),
            //alignment: Alignment.center,
            child: Stack(
              children: [
                Positioned(
                  top: _height * 0.02,
                  right: _width * 0.1,
                  left: _width * 0.1,
                  child: Text(widget.serviceTitle,
                      textAlign: TextAlign.center,
                      style: brandTextStyle(white, 25)),
                ),
                Positioned(
                  right: _width * 0.1,
                  left: _width * 0.1,
                  bottom: _height * 0.1,
                  child: Text(widget.serviceDescription,
                      textAlign: TextAlign.center,
                      style: typerTextStyle(white, 14)),
                )
              ],
            ),
          ),
        ),
      ),
    ),
  ),

你應該使用: filter: ImageFilter.blur(sigmaX: 0.001, sigmaY: 0.001),

代替:

 filter: ImageFilter.blur(sigmaX: 0, sigmaY: 0),

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM