clojuredart:主机编译时的错误(ns samples.tables.tables(:quired offect; package:flutter/材料。

发布于 2025-01-30 08:37:00 字数 1364 浏览 1 评论 0原文

这是痕迹:

发生了一些可怕的事情! :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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷你仙 2025-02-06 08:37:00

首先,确保您

dependencies:
  flutter:
    sdk: flutter

在PubSpec.yaml中有;它用于Clojuredart查找颤音库。
如果否,添加它,请删除.clojuredart文件夹,运行flutter Pub get

您可以看到该错误发生在文件的开头,并有要求。
实际上,我只是忘记了将添加到关键字:as

[cljd.flutter.alpha as f] - > [Cljd.flutter.alpha:as f]

First, make sure you have

dependencies:
  flutter:
    sdk: flutter

in your pubspec.yaml ; it is used for clojureDart to find flutter librairies.
If no, add it, remove the .clojuredart folder, run flutter pub get and t

You 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]

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文