Giter Site home page Giter Site logo

Comments (6)

bit-burger avatar bit-burger commented on August 28, 2024 1

@bdlukaa yes im sorry for not making it directly clear

from supabase-dart.

bdlukaa avatar bdlukaa commented on August 28, 2024

Duplicate of #64.

Also, could you not create another issue with the same information?

from supabase-dart.

bit-burger avatar bit-burger commented on August 28, 2024

@bdlukaa Sry accidentally sent it two times because i had duplicated the tab, won't happen again!

from supabase-dart.

bit-burger avatar bit-burger commented on August 28, 2024

But i am failing to understand how this is a duplicate, no one mentions int columns or whatever type being changed to String columns, I even have overridden my dependencies with that exact branch of Supabase before it was merged, because before that nothing worked and after the installing of that branch there were the issues with the String columns, so it is definitely not fixed

from supabase-dart.

bdlukaa avatar bdlukaa commented on August 28, 2024

RealtimeSubscription Unhandled Exception: type 'Null' is not a subtype of type 'List' in type cast error

I assumed the issue was with this.

from supabase-dart.

bit-burger avatar bit-burger commented on August 28, 2024

Here a small bit of code to maybe better understand the problem:

create domain points as bigint check (value >= 0);
create domain color as smallint check ((value >= 0) and (value < 10));
create domain icon as smallint check ((value >= 0) and (value < 230));

create table public.profiles(
  id uuid primary key references auth.users on delete cascade,
  name varchar(8) not null check(name ~ '^(?!-|\s)([a-z-]|\s)*[a-z]$'),
  status varchar(16) not null default 'im new to points',
  bio varchar(256) not null,
  color color not null default 9,
  icon icon not null default 0,
  points points not null default 0,
  gives points not null default 0
);
_client.from("profiles:id=eq.$userId").on(
        SupabaseEventTypes.update,
        (payload) {
          final user = payload.newRecord!;
          // TODO: Temp fix
          if (user["color"] is String) {
            user["color"] = int.parse(user["color"]);
          }
          if (user["icon"] is String) {
            user["icon"] = int.parse(user["icon"]);
          }
          if (user["points"] is String) {
            user["points"] = int.parse(user["points"]);
          }
          if (user["gives"] is String) {
            user["gives"] = int.parse(user["gives"]);
          }
          // Now the user can actually be used
        },
      )

As you can see I have to convert each and every column (I put them in ifs checking the type incase Supabase changes again)

from supabase-dart.

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.