草庐IT

dart-polymer

全部标签

dart - '无效的覆盖。实现接口(interface)时类型不是子类型

我正在尝试将MealsRepository接口(interface)实现到MealsRepositoryImpl中,但出现以下错误:Invalidoverride.Thetypeof'MealsRepositoryImpl.findAllForCanteenByDate'('(int,DateTime)->FutureMapint,dynamic')isn'tasubtypeof'MealRepository.findAllForCanteenByDate'('(int,DateTime)->FutureMapint,Meal').我看不出我的错误。我目前正在通过Dart插件使用Int

dart - '无效的覆盖。实现接口(interface)时类型不是子类型

我正在尝试将MealsRepository接口(interface)实现到MealsRepositoryImpl中,但出现以下错误:Invalidoverride.Thetypeof'MealsRepositoryImpl.findAllForCanteenByDate'('(int,DateTime)->FutureMapint,dynamic')isn'tasubtypeof'MealRepository.findAllForCanteenByDate'('(int,DateTime)->FutureMapint,Meal').我看不出我的错误。我目前正在通过Dart插件使用Int

dart - 当值更改时,我的 CachedNetworkImage 不会更改

@overrideWidgetbuild(BuildContextcontext){varswitchButton=newSwitch(value:detail,onChanged:(boolvalue){setState((){detail=value;});},);varimagejadwal=newCachedNetworkImage(imageUrl:switchButton.value?"https://drive.google.com/uc?export=download&id=1v-dA5bG7Fwk_hJvL2wu4Z9P10JdsaWIe":"https://driv

dart - 当值更改时,我的 CachedNetworkImage 不会更改

@overrideWidgetbuild(BuildContextcontext){varswitchButton=newSwitch(value:detail,onChanged:(boolvalue){setState((){detail=value;});},);varimagejadwal=newCachedNetworkImage(imageUrl:switchButton.value?"https://drive.google.com/uc?export=download&id=1v-dA5bG7Fwk_hJvL2wu4Z9P10JdsaWIe":"https://driv

dart - 如何在 ListView 的顶部插入小部件?

简要说明:在我所有的代码示例中,您将看到诸如material.Widget而不仅仅是Widget。这是因为我喜欢这样命名我的导入,例如:import'package:flutter/material.dart'asmaterial;我的问题:我正在尝试让ListView在列表顶部显示新添加的小部件。我有一个简单的有状态小部件,它只包含一个模型列表(包含构建进入ListView的小部件的必要信息的类),并且应该根据该列表构建ListView的子级。classPageextendsmaterial.StatefulWidget{finalListcardModels;Page(this.c

dart - 如何在 ListView 的顶部插入小部件?

简要说明:在我所有的代码示例中,您将看到诸如material.Widget而不仅仅是Widget。这是因为我喜欢这样命名我的导入,例如:import'package:flutter/material.dart'asmaterial;我的问题:我正在尝试让ListView在列表顶部显示新添加的小部件。我有一个简单的有状态小部件,它只包含一个模型列表(包含构建进入ListView的小部件的必要信息的类),并且应该根据该列表构建ListView的子级。classPageextendsmaterial.StatefulWidget{finalListcardModels;Page(this.c

mobile - 如何从 Dart 中的异步数据中提取?

我正在尝试读取文件(异步)并返回数据列表。然后,我想在每个给定的数字都是线高时使用CustomPainter画线(我想画多条线)classBarChartPainterextendsCustomPainter{@overridepaint(Canvascanvas,Sizesize){finalpaint=newPaint()..color=AppColors.primaryColor..style=PaintingStyle.fill;varfuturePath=run();futurePath.then((height){print('1:$height');for(varline

mobile - 如何从 Dart 中的异步数据中提取?

我正在尝试读取文件(异步)并返回数据列表。然后,我想在每个给定的数字都是线高时使用CustomPainter画线(我想画多条线)classBarChartPainterextendsCustomPainter{@overridepaint(Canvascanvas,Sizesize){finalpaint=newPaint()..color=AppColors.primaryColor..style=PaintingStyle.fill;varfuturePath=run();futurePath.then((height){print('1:$height');for(varline

dart - 使用 Dart 和 Flutter 在类中声明一个 Map 列表

我尝试删除List>_work;使用不同的语法但它仍然失败并给出错误type'MappedListIterable'isnotasubtypeoftype'List>.....MappedListIterableisfromdart:_internalListisfromdart:coreMapisisfromdart:coreStringisfromdart:coreObjectisfromdart:core.....我想声明一个变量,它是一个Map列表,键是String,值是Object。我应该怎么做?非常感谢任何帮助 最佳答案

dart - 使用 Dart 和 Flutter 在类中声明一个 Map 列表

我尝试删除List>_work;使用不同的语法但它仍然失败并给出错误type'MappedListIterable'isnotasubtypeoftype'List>.....MappedListIterableisfromdart:_internalListisfromdart:coreMapisisfromdart:coreStringisfromdart:coreObjectisfromdart:core.....我想声明一个变量,它是一个Map列表,键是String,值是Object。我应该怎么做?非常感谢任何帮助 最佳答案