我尝试在另一个类的另一个小部件中返回 MealItem 类的构造函数,我正确地执行了导入,并且得到了这个
错误:未为类型“Iterable”定义运算符“[]”。尝试定义运算符 '[]'.dartundefined_operator
这里是 MealItem 类
import 'package:flutter/material.dart';
import '../models/meal.dart';
class MealItem extends StatelessWidget {
final String title;
final String imageUrl;
final int duration;
final Complexity complexity;
final Affordability affordability;
MealItem(
this.title,
this.imageUrl,
this.duration,
this.complexity,
this.affordability
);
}
}
Run Code Online (Sandbox Code Playgroud)
这是 CategoryMealsScreen 类中的错误
import 'package:flutter/material.dart';
import '../widgets/meal_item.dart';
import '../models/dummy_data.dart';
class CategoryMealsScreen extends StatelessWidget {
static const routeName = '/CategoriesScreen';
//final String categoryId;
//final String categoryTitle;
//CategoryMealsScreen(this.categoryId,this.categoryTitle);
@override
Widget build(BuildContext context) {
final routeArgs =
ModalRoute.of(context).settings.arguments as Map<String, …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 LogStash 将 SQL Server 数据复制到 Elasticsearch,实现我自己的名为 sql.conf的配置脚本
我收到以下错误:
WARNING, using JAVA_HOME while Logstash distribution comes with a bundled JDK
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Sending Logstash logs to C:/Program Files/Elastic/logstash-7.11.1/logs which is now configured via log4j2.properties
[2021-02-25T14:57:05,899][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"7.11.1", "jruby.version"=>"jruby 9.2.13.0 (2.5.7) 2020-08-03 9a89c94bcc Java HotSpot(TM) 64-Bit Server VM 11.0.10+8-LTS-162 on 11.0.10+8-LTS-162 +indy +jit [mswin32-x86_64]"}
[2021-02-25T14:57:06,132][WARN ][logstash.config.source.multilocal] Ignoring the …Run Code Online (Sandbox Code Playgroud) 我在使用material.dart库中的Colors.black属性时遇到错误。
错误:无法将“Color”类型的值分配给“String”类型的变量。尝试更改变量的类型,或将右侧类型转换为“String”。
import 'package:flutter/material.dart';
class Category {
final String id;
final String title;
final String color;
const Category({
@required this.id,
@required this.title,
this.color = Colors.black,
});
}
Run Code Online (Sandbox Code Playgroud)
任何帮助将不胜感激