Giter VIP home page Giter VIP logo

Comments (7)

borkdude avatar borkdude commented on June 1, 2024

In normal Clojure(Script) you can write this as:

(.. m/EdgeInsets.symmetric (horizontal 10) (vertical 5))

Why does ClojureDart need to deviate from this?

from clj-kondo.

valerauko avatar valerauko commented on June 1, 2024

Those are not separate methods, but named parameters to the EdgeInsets constructor symmetric

https://api.flutter.dev/flutter/painting/EdgeInsets/EdgeInsets.symmetric.html

from clj-kondo.

valerauko avatar valerauko commented on June 1, 2024

For example

;; :require ["package:flutter/material.dart" :as m]
(=
 (m/WidgetsBinding.instance.removeObserver some-observer)
 (.removeObserver (.-instance m/WidgetsBinding) some-observer)
 (-> m/WidgetsBinding .-instance (.removeObserver some-observer)))

from clj-kondo.

borkdude avatar borkdude commented on June 1, 2024

I understand those interop forms, but I don't understand your remark about "those are not separate methods" and then saying "for example" where no named parameters occur in the example, or am I missing something?

from clj-kondo.

borkdude avatar borkdude commented on June 1, 2024

ClojureDart could support:

(m/EdgeInsets.symmetric :.horizontal 10 :.vertical 5)

or similar for named parameters, has this been considered?

from clj-kondo.

borkdude avatar borkdude commented on June 1, 2024

I misunderstood the issue. MainAxisAlignment.center gives a false positive, but the rest works.

When you lint the above as CLJS it does work:

clj-kondo --lint tmp/dart.cljd --lang cljs
linting took 41ms, errors: 0, warnings: 0

So we just have to convince clj-kondo to do the same as ClojureScript when using ClojureDart

from clj-kondo.

valerauko avatar valerauko commented on June 1, 2024

Yeah it's very similar to the js/console.log kind of cljs syntax. Gotta add a possible refer to the mix though (the false positive you mention)

from clj-kondo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.