clojuredart:主机编译时的错误(ns samples.tables.tables(:quired offect; package:flutter/材料。
这是痕迹:
发生了一些可怕的事情! :scream:主机编译时错误(NS样本。 [cljd.flutter.alpha as f]))(ns samples.tables“忠实的端口https://docs.flutter.dev/cookbook/design/tabs”(:quirect [quirect offect offect offect:quirect offect offect offect offect offect/package fultutter/yaters.dart':如m] [cljd.flutter.alpha as f])))无法解析小部件/senasenitedmodel(无源位置)
,这是我的代码:
(ns samples.tabs
"Faithful port of https://docs.flutter.dev/cookbook/design/tabs"
(:require
["package:flutter/material.dart" :as m]
[cljd.flutter.alpha as f]))
(defn main
[]
(let [title "Tabs Demo"]
(m/runApp
(m/MaterialApp
:title title
:home
(m/DefaultTabController
:length 3
:child
(m/Scaffold
:appBar
(m/AppBar
:bottom
(m/TabBar
:tabs [(m/Tab :icon (m/Icon. m.Icons/directions_car)),
(m/Tab :icon (m/Icon. m.Icons/directions_transit)),
(m/Tab :icon (m/Icon. m.Icons/directions_bike))]))
:body
(m/TabBarView
:children [(m/Tab :icon (m/Icon. m.Icons/directions_car)),
(m/Tab :icon (m/Icon. m.Icons/directions_transit)),
(m/Tab :icon (m/Icon. m.Icons/directions_bike))])))))))
我们可以注意到,跟踪提及该模块的所有声明和要求,但也不是很明确。您还可以认为小部件库存在问题。
Here is the trace:
Something horrible happened! :scream: Error while host-compiling (ns samples.tables "Faithful port of https://docs.flutter.dev/cookbook/design/tabs" (:require ["package:flutter/material.dart" :as m] [cljd.flutter.alpha as f])) (ns samples.tables "Faithful port of https://docs.flutter.dev/cookbook/design/tabs" (:require ["package:flutter/material.dart" :as m] [cljd.flutter.alpha as f])) Can't resolve widgets/InheritedModel (no source location)
And here is my code:
(ns samples.tabs
"Faithful port of https://docs.flutter.dev/cookbook/design/tabs"
(:require
["package:flutter/material.dart" :as m]
[cljd.flutter.alpha as f]))
(defn main
[]
(let [title "Tabs Demo"]
(m/runApp
(m/MaterialApp
:title title
:home
(m/DefaultTabController
:length 3
:child
(m/Scaffold
:appBar
(m/AppBar
:bottom
(m/TabBar
:tabs [(m/Tab :icon (m/Icon. m.Icons/directions_car)),
(m/Tab :icon (m/Icon. m.Icons/directions_transit)),
(m/Tab :icon (m/Icon. m.Icons/directions_bike))]))
:body
(m/TabBarView
:children [(m/Tab :icon (m/Icon. m.Icons/directions_car)),
(m/Tab :icon (m/Icon. m.Icons/directions_transit)),
(m/Tab :icon (m/Icon. m.Icons/directions_bike))])))))))
We can notice that the trace mention all of the declaration of the module and the requirements, but is not very explicit either. You could also think that there is a problem with the widget library.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,确保您
在PubSpec.yaml中有;它用于Clojuredart查找颤音库。
如果否,添加它,请删除
.clojuredart
文件夹,运行flutter Pub get
,您可以看到该错误发生在文件的开头,并有要求。
实际上,我只是忘记了将
:
添加到关键字:as
。[cljd.flutter.alpha as f]
- >[Cljd.flutter.alpha:as f]
First, make sure you have
in your pubspec.yaml ; it is used for clojureDart to find flutter librairies.
If no, add it, remove the
.clojuredart
folder, runflutter pub get
and tYou can see that the error occurs at the beginning of the file, with the requirements.
Actually, I just forgotten to add
:
to the keyword:as
.[cljd.flutter.alpha as f]
->[cljd.flutter.alpha :as f]