[英]The library 'package:flutter/material.dart' is legacy, and should not be imported into a null safe library
[英]The library 'package:vin_decoder/vin_decoder.dart' is legacy, and should not be imported into a null safe library
我正在嘗試在我的應用程序中使用 vin 解碼器 package。 當我導入 package 時:
import 'package:vin_decoder/vin_decoder.dart';
但我收到此警告:
庫“package:vin_decoder/vin_decoder.dart”是遺留的,不應導入到 null 安全庫中。 嘗試遷移導入的庫。
我的 pubspec.yaml 在依賴項下有這個:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.2
vin_decoder: ^0.1.4
有人可以解釋我做錯了什么嗎? 我檢查了這個堆棧溢出問題,但沒有任何效果。 謝謝。
你沒有做錯任何事。 目前這個package還沒有發布null安全版本,你的項目是null安全的。 檢查package ,有一個預發布版本0.2.1-nullsafety
。 要么等待它發布,要么使用這個預發布版本,當然它可能包含錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.