我已经克隆了由谷歌开发人员在 YouTube 上的颤动无聊节目系列中开发的hackernews 项目。在运行 flutter run 时,我收到这些错误。
The current Dart SDK version is 2.9.2.
Because no versions of test match >1.13.0 <1.14.0 and test >=1.16.0-nullsafety requires SDK version >=2.10.0-0 <2.10.0, test >1.13.0 <1.14.0-? or >=1.16.0-nullsafety is forbidden.
(1) So, because test >=1.3.0 <1.12.0 depends on boolean_selector ^1.0.0 and test >=1.12.0 <1.13.0 depends on test_api 0.2.14, test >=1.3.0 <1.13.0-? or >1.13.0 <1.14.0-? or >=1.16.0-nullsafety requires boolean_selector ^1.0.0 or test_api 0.2.14.
Because test >=1.14.5 <1.15.0 depends on test_api 0.2.16 and test >=1.13.0 …Run Code Online (Sandbox Code Playgroud) 我在使用时无法热重载serverless offline start。
这是我的 serverless.yml 文件
service: function-with-environment-variables
frameworkVersion: ">=3.0.0 <4.0.0"
provider:
name: aws
runtime: nodejs16.x
plugins:
- serverless-offline
functions:
register:
handler: handler.register
events:
- http:
path: /register
method: post
login:
handler: handler.login
events:
- http:
path: /login
method: post
verify:
handler: handler.verify
events:
- http:
path: /verify
method: post
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用sls offline start仍然面临同样的错误。
这是输出serverless --version
`从node_modules运行“无服务器”框架核心:3.24.1(本地)3.24.1(全局)插件:6.2.2 SDK:4.3.2
如何使用颤振在 android 设备上获取当前位置。我已经尝试了Location和GeoLocator插件,GeoLocator 3.0.0 在调试时显示此错误:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Run Code Online (Sandbox Code Playgroud)
FAILURE:构建失败,出现异常。
Android 依赖项“android.arch.lifecycle:runtime”对于编译 (1.0.0) 和运行时 (1.1.0) 类路径具有不同的版本。您应该通过 DependencyResolution 手动设置相同的版本
位置 2.0.0也会在调试时引发错误。还有另一个名为geoLocation 的插件可用,但它与 dart 2.0 不兼容。在这种情况下,我如何获得位置(经度和纬度)[一次]?任何帮助将不胜感激。
android dart location-services flutter google-location-services
我正在创建一个搜索小部件,我希望它有一点高度,我可以通过使用 Material 小部件来做到这一点,但是 Material 还具有其他属性,例如颜色,并且当我用 Material 小部件包裹容器时,它会创建奇怪的边缘。
Widget search(BuildContext context) {
var theme = Provider.of<ThemeNotifier>(context);
return Container(
margin: EdgeInsets.only(top: 28, left: 10, right: 10),
child: Material(
elevation: 10,
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),
color: theme.getTheme().materialTheme.buttonColor,
),
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
InkWell(onTap: () => print("Menu tapped"), child: Icon(Icons.menu)),
Expanded(
child: TextField(
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 15, right: 15),
hintText: "Search City",
filled: false,
border: InputBorder.none),
),
),
Icon(Icons.search),
],
),
),
),
);
}
Run Code Online (Sandbox Code Playgroud)
这是我的小部件的样子: