mmvergara / supadart

Typesafe queries in Supabase Flutter! Generate Flutter / Dart 🎯 classes from your Supabase schema.
https://supadart.vercel.app
MIT License
43 stars 5 forks source link

The argument type 'dynamic' can't be assigned to the parameter type 'String'. #5

Closed noga-dev closed 5 months ago

noga-dev commented 5 months ago

image

mmvergara commented 5 months ago

@noga-dev Thanks for opening an issue, the tool is now updated try again, and let me know if you still have problems. 🙏

noga-dev commented 5 months ago

@noga-dev Thanks for opening an issue, the tool is now updated try again, and let me know if you still have problems. 🙏

image

image

mmvergara commented 5 months ago

@noga-dev I think it's fixed. added explicit type casting which i didn't know is a convention and more importantly my IDE wasn't saying anything about that error.. do i have a old version of dart or something? weirdd.

noga-dev commented 5 months ago

image

mmvergara commented 5 months ago

more importantly my IDE wasn't saying anything about that error.. do i have a old version of dart or something? weirdd.

Found it why,, I need this on pubspec.yml

analyzer:
  language:
    strict-casts: true
    strict-raw-types: true
noga-dev commented 5 months ago

Fwiw I'm on 3.22.2

noga-dev commented 5 months ago

my analysis_options.dart:

# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:very_good_analysis/analysis_options.yaml

analyzer:
  plugins:
    - custom_lint
  # errors:
    # invalid_annotation_target: ignore
  exclude:
    - "lib/**.g.dart"
    - "lib/**.f.dart"
    - "lib/gen/**.dart"
  warnings:
    # unused_element: ignore
  errors:
    unused_element: false

custom_lint:
  rules:

linter:
  rules:
    # avoid_print: false  # Uncomment to disable the `avoid_print` rule
    # prefer_single_quotes: true  # Uncomment to enable the `prefer_single_quotes` rule
    public_member_api_docs: ignore

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
mmvergara commented 5 months ago

@noga-dev I think it's finally fixed. added missing explicit type casting . try the cli.

mmvergara commented 5 months ago

let me know if you still have problems, i tried it on a table with all the postgres types, tests seems to be doing fine.

noga-dev commented 5 months ago

image

noga-dev commented 5 months ago

No more error, just 4 warnings

mmvergara commented 5 months ago

@noga-dev I see that you have a dynamic type there it means that it is not supported yet. what is type is that? cause i don't have one in the test table that returns that type.

also regarding the imports i can program it to conditionally render those imports if needed.

noga-dev commented 5 months ago

image

noga-dev commented 5 months ago

Ideally I should have this column as a 1-to-many as it's a list of UUID's but there's no way to set that up atm so I have to think of a workaround.

mmvergara commented 5 months ago

gotcha. thanks

image

The define as array option will introduced a bit of a complexity , i didn't know about this. but it's probably doable, but will be hard to implement, the current implementation does parsing for all the methods. so i hope utilizing the .map method here would do me wonders

We'll leave this issue open