添加网络支持后发布我的包时出现此错误
\nPackage validation found the following error:\n* line 9, column 1 of lib/hexcolor_web.dart: This package does not have flutter_web_plugins in the `dependencies` section of `pubspec.yaml`.\n \xe2\x95\xb7\n 9 \xe2\x94\x82 import 'package:flutter_web_plugins/flutter_web_plugins.dart';\n \xe2\x94\x82 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nRun Code Online (Sandbox Code Playgroud)\n 我是 Flutter 的初学者,我打开/打开了一个模拟器,但 android studio 没有检测到它。 1
因此我无法运行任何程序,因为“没有设备正在运行”。我已经尝试在 SDK 工具中安装“Android 模拟器”,但 android studio 仍然无法检测到它。
我设法使用/flutter_3d_obj在颤振上显示 3d 对象。我现在正在尝试获取颤动中点击点的坐标。我该怎么做。或者在颤振中显示 3d 对象的最佳方式是什么?并有能力获得一个点的坐标。
getActivity()和getApplicationContext()片段的正确用法是什么。
当在片段中获得意图时,你使用的getActivity()地方和你使用的地方getAppliationContext();
getActivity() 和 getApplicationContext()
我通过对每个细节进行硬编码来做到这一点。但我想动态地实现这一点。
问题是 - 如果我编码一段时间,我将输入我编码的小时数,如果我实现了里程碑,里程碑文本必须变为红色,下一个里程碑必须变为绿色。
这是我到目前为止的代码
我的里程碑清单
List milestoneList = [10, 25, 50, 100, 250, 500, 750, 1000];
将列表映射到小部件
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: milestoneList.map((item) {
return Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
item.toString(),
style: TextStyle(
fontWeight: FontWeight.bold,),
),
);
}).toList(),
Run Code Online (Sandbox Code Playgroud)
到目前为止,我能够破解我需要将值传递给color的参数TextStyle。我无法思考超出这一点的事情。
由于 flutter_chat_app 依赖 firebase_analytics 0.0.4,需要 SDK 版本 >=1.8.0 <2.0.0,版本解析失败。pub get failed (1) 退出代码 1
dependencies:
flutter:
sdk: flutter
image_picker: 0.1.1
google_sign_in: 0.3.1
firebase_analytics: 0.0.4
firebase_auth: 0.2.0
firebase_database: 0.0.12
firebase_storage: 0.0.5
Run Code Online (Sandbox Code Playgroud) 我想在 image.asset() 中显示随机图像,这是我尝试过的
static var listImagesnotFound = [
"assets/cactusno.jpg",
"assets/colorednot.jpg",
"assets/juno.jpg",
"assets/notfound.png",
"assets/robno.png",
"assets/spano.jpg"
];
static var _random = Random();
var imageToShow =
listImagesnotFound[_random.nextInt(listImagesnotFound.length)];
}
Image.asset(listImagesnotFound.toString()),
Run Code Online (Sandbox Code Playgroud)