Enums You can use the enum keyword to specify possible values of a request parameter or a model property. The additional number types are just aliases for the native Dart types, so using short, for example, works the same as using int. If you use OpenAPI 2.0, see our OpenAPI 2.0 guide. Isar supports additional types that allow you to save space and memory when storing smaller numbers. Prerequisites: youre using NSwag or Openapi-generator to generate API client you. # byte, short, floatįor many use cases, you don't need the full range of a 64-bit integer or double. In order to generate enums with name and value you can use this solution. # Supported typesĪdditionally, embedded objects and enums are supported. Keep in mind that it is not good practice to store information in Isar objects that are not persisted. If you want a non-nullable auto-increment id, you can use toIncrement instead of null. If the id field is null and not final, Isar will assign an auto-increment id. You can either set ids yourself or ask Isar to assign an auto-increment id. Isar automatically indexes id fields, which allows you to get and modify objects based on their id efficiently. The oneOf different const values allows you to define an extended enum structure with any additional information required, ending with an equivalent result. Id is just an alias for int that allows the Isar Generator to recognize the id property. These are also respected for super classes.Įach collection class has to define an id property with the type Id uniquely identifying an object. Enabled by default.Īllows you to rename the default collection accessor (for example ntacts for the Contact collection).Īllows ignoring certain properties. There are a few optional parameters to customize the collection: ConfigĬontrol whether fields of parent classes and mixins will be stored in Isar. You can ensure Isar has access to a field by making it public or by providing getter and setter methods. To persist a field, Isar must have access to it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |