Coder Social home page Coder Social logo

Comments (4)

tshedor avatar tshedor commented on July 17, 2024

@MilesAdamson in your Ticket.dart model, how are you accessing Template or Company?

Ideally, they would look like this:

class Ticket extends OfflineFirstWithRestModel {
  final Template template;
  final Company company;
}

If Template and Company are models in their own right, Brick should generate a Template.fromRest. But if they're not declared at all, they won't appear in the adapter

from brick.

MilesAdamson avatar MilesAdamson commented on July 17, 2024

I'm not sure if it had something to do with the class hierarchy I had, but I have since fixed this issue by deleting the TicketStub class and just letting company and template be null if the ticket is a "stub".

Template and Company are both Identifiable, and both had adapters created properly. Issue was, in the _$TicketFromRest method data was missing them. But with just Ticket extends Identifiable it's now working, not sure why

class Ticket extends TicketStub {
  final Company company;
  final Template template;
  
class TicketStub extends Identifiable {
  final int id;
  // many other things...
abstract class Identifiable extends OfflineFirstWithRestModel implements Comparable {
  final dynamic id;

from brick.

tshedor avatar tshedor commented on July 17, 2024

Interesting...there must be something in the way analyzer detects the class. There must be a way to keep going further up the tree and detect if OfflineFirstWithRestModel is a super at any point. I'll do some digging.

from brick.

tshedor avatar tshedor commented on July 17, 2024

@MilesAdamson can you please give #67 a test? I think that should fix this.

from brick.

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.