nylo-core / nylo

Nylo is the fastest way to build your next Flutter mobile app. Streamline your projects with Nylo's opinionated approach to building Flutter apps. Develop your next idea ⚡️

Home Page:https://nylo.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Having Problem after auth.login and restart application

jitendravn opened this issue · comments

Caution

flutter: error : FormatException: Unexpected character (at character 1)
Instance of 'User'
^

Error come from

  @override
  boot(Nylo nylo) async {
    await event<SyncAuthToBackpackEvent>();

    return nylo;
  }

  @override
  afterBoot(Nylo nylo) async {}
}

@agordn52

Hi @jitendravn,

Which Model are you trying to auth?
By default, Nylo will expect the model to be of Type User

Hi @jitendravn,

In your User model have you correctly set up toJson?

Also, in your decoders.dart file have you implemented a User decoder?

@agordn52 But I'm Using Freezed for model

@agordn52 But I'm Using Freezed for model

You need to implement a 'decoder' for the model and have a 'toJson' method if you want to use Auth in Nylo.

For now I have removed Freezed from my User model class
i have implemented this
class User extends Model{}