英文:
Flutter 'package:socket_io/socket_io.dart' library doesn't exist
问题
我尝试添加Flutter包socket.io,但它不存在。我尝试添加package:socket_io_client/socket_io_client.dart和package:socket_io/socket_io.dart' as IO;库,但出现了问题。导入'dart:async';
导入'package:flutter/material.dart';这两个库没有问题。我该如何解决这个问题?
英文:
I tried add the flutter package socket.io but it doesn't exist. I tried add package:socket_io_client/socket_io_client.dart and package:socket_io/socket_io.dart' as IO; libraries but I have a problem. import 'dart:async';
import 'package:flutter/material.dart'; No problems these last two libraries. How can i solve this problem?
答案1
得分: 1
在你可以导入该包之前,你必须将它添加到pub。尝试以下命令
flutter pub add socket_io_client
这将导致你的pubspec.yaml文件更新。然后,你可以运行flutter pub get
来更新项目中的依赖项。
英文:
Before you can import the package, you must add it to pub. Try the command
flutter pub add socket_io_client
This will cause your pubspec.yaml file to update. Then, you can run flutter pub get
to update the dependencies across your project.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论