gpt4 book ai didi

Flutter Ubuntu Android Studio->找不到URI目标不存在

转载 作者:行者123 更新时间:2023-12-04 18:43:05 24 4
gpt4 key购买 nike

文件内声明的 const 值:

import 'package:flutter/material.dart';
import 'package:flutter_complete_guide/models/category.dart';
import 'package:flutter_complete_guide/models/meal.dart';

const kDummyMeals = <Meal>[
Meal(
id: 'm1',
categories: [
'c1',
'c2',
],
title: 'Spaghetti with Tomato Sauce',
affordability: Affordability.Affordable,
complexity: Complexity.Simple,
imageUrl:
'https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Spaghetti_Bolognese_mit_Parmesan_oder_Grana_Padano.jpg/800px-Spaghetti_Bolognese_mit_Parmesan_oder_Grana_Padano.jpg',
duration: 20,
ingredients: [
'4 Tomatoes',
'1 Tablespoon of Olive Oil',
'1 Onion',
'250g Spaghetti',
'Spices',
'Cheese (optional)'
],
steps: [
'Cut the tomatoes and the onion into small pieces.',
'Boil some water - add salt to it once it boils.',
'Put the spaghetti into the boiling water - they should be done in about 10 to 12 minutes.',
'In the meantime, heaten up some olive oil and add the cut onion.',
'After 2 minutes, add the tomato pieces, salt, pepper and your other spices.',
'The sauce will be done once the spaghetti are.',
'Feel free to add some cheese on top of the finished dish.'
],
isGlutenFree: false,
isVegan: true,
isVegetarian: true,
isLactoseFree: true,
),
// some other values
]
我通过以下方式使用这个常量:
enter image description here
错误 :
URI 的目标不存在:'package:flutter_complete_guide/dummy_categories.dart'。 (文档)尝试创建由 URI 引用的文件,或尝试对确实存在的文件使用 URI。
结构 :
enter image description here
flutter 医生
医生摘要(要查看所有详细信息,请运行 flutter doctor -v):
[✓] Flutter (Channel stable, 2.0.6, on Linux, locale uk_UA.UTF-8)
[✓] Android 工具链 - 为 Android 设备开发(Android SDK 版本 30.0.3)
[✓] Chrome - 为网络开发
[✓] Linux 工具链 - 为 Linux 桌面开发
[✓] 安卓工作室
[✓] 连接设备(2 个可用)
• 未发现任何问题!
安卓工作室 4.2

最佳答案

您是否可以使用完整路径更改导入。不同之处在于“模型”文件夹,如下所示:

package:flutter_complete_guide/models/dummy_categories.dart'. 
这是一个例子:
  • 进口声明

  • import 'package:todo_app/app/global/colors.dart';


  • 结构:

  • enter image description here

    关于Flutter Ubuntu Android Studio->找不到URI目标不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67517512/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com