我尝试通过 构建 ios 应用程序时遇到错误flutter build ios
。该错误与软件包有关flutter_tools
。我尝试用以下方法清理我的项目:
flutter clean
Podfile.lock
重新运行pod install
ios/
ios/Pods
目录我没有其他想法要做什么。这是我的整个错误日志:
\n[+1019 ms] "flutter ios" took 14,767ms.\n[ +4 ms] Encountered error while building for device.\n[ +2 ms] \n #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)\n #1 _BuildIOSSubCommand.runCommand (package:flutter_tools/src/commands/build_ios.dart:256:7)\n <asynchronous suspension>\n #2 FlutterCommand.verifyThenRunCommand\n(package:flutter_tools/src/runner/flutter_command.dart:1157:12)\n <asynchronous suspension>\n #3 FlutterCommand.run.<anonymous closure>\n(package:flutter_tools/src/runner/flutter_command.dart:1009:27)\n <asynchronous suspension>\n #4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)\n <asynchronous suspension>\n #5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)\n <asynchronous suspension>\n #6 CommandRunner.runCommand (package:args/command_runner.dart:197:13)\n <asynchronous suspension>\n #7 …
Run Code Online (Sandbox Code Playgroud) 我是 Flutter 开发的新手。我收到错误
列表不是“Iterable”类型的子类型
到目前为止我已经做到了这一点。
模型类
class Categories {
final String title;
final Items items;
Categories({this.title, this.items});
factory Categories.fromJson(Map<String, dynamic> json) {
return new Categories(
title: json['title'],
items: Items.fromJson(json['Items']));
}
}
class Items {
final String tag;
final String childId;
final String category;
final String isNew;
Items({this.tag, this.childId, this.category, this.isNew});
factory Items.fromJson(Map<String, dynamic> json) {
return new Items(
tag: json['id'],
childId: json['child_category_id'],
category: json['category'],
isNew: json['new']);
}}
Run Code Online (Sandbox Code Playgroud)
缅因州内舱
List<Categories> categories = [];
var loading = false;
Future<Null> getNavigationItems() async { …
Run Code Online (Sandbox Code Playgroud) 我正在开发一个应用程序,用户可以登录该应用程序并可以在文本表单字段中输入文本。它还可以应用不同的字体样式和字体系列并从中生成图像。
有可能实现吗?
任何帮助将不胜感激
我正在尝试阅读,shared preferences
但我被卡住了。我有这个错误,我不知道如何处理它:
A value of type 'Future<bool>' can't be assigned to a variable of type 'bool'
我的代码如下所示:
onTap: () {
setState(() {
if (_getPref()) { //here occurs the error
_stateColor = _disableColor;
_setPref(false);
} else {
_stateColor = _enableColor;
_setPref(true);
}
});
},
Run Code Online (Sandbox Code Playgroud)
和方法:
Future<bool> _getPref() async {
SharedPreferences prefs = await SharedPreferences.getInstance();
bool value = prefs.getBool(widget.myIndex) ?? false;
return value;
}
Run Code Online (Sandbox Code Playgroud)
如果有人帮助我,我将不胜感激!