簡體   English   中英

無法正常運行 null 安全

[英]cannot run with sound null safety

在這里,當我運行代碼時,它給了我這個問題......

錯誤的圖片

這是我的依賴。

 # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  # carousel_slider: ^2.3.1
  cupertino_icons: ^1.0.2
  carousel_slider: ^2.3.1
  http: ^0.13.3
  get: ^4.3.8
  firebase_auth: ^3.1.1
  cloud_firestore: ^2.5.3
  firebase_core: ^1.6.0
  google_sign_in: ^5.2.1
  flutter_local_notifications: ^9.0.2
  firebase_messaging: ^11.0.0
  # google_maps_flutter: ^2.1.0
  # location: ^4.3.0

它是代碼,庫的第一行給出了錯誤,或者說它是說取消發送導入

import 'package:carousel_slider/carousel_slider.dart';
import 'package:flutter/material.dart';

class HomeScreen extends StatelessWidget {

  const HomeScreen({Key? key}) : super(key: key);
@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        children: [
          CarouselSlider(
            items: [
              //1st Image of Slider
              Container(
                decoration: BoxDecoration(
                  image: const DecorationImage(
                    image: NetworkImage("")
                ),
               ),
  }
}

謝謝你的幫助!

單擊 main.dart 單擊 Edit Configuration 然后在 Additional run args 列中寫入 --no-sound-null-safety

或將旋轉木馬 slider 更新為

 carousel_slider: ^4.0.0

暫無
暫無

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

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