| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- // GENERATED CODE - DO NOT MODIFY BY HAND
- // ignore_for_file: camel_case_types
- import 'dart:typed_data';
- import 'package:objectbox/flatbuffers/flat_buffers.dart' as fb;
- import 'package:objectbox/internal.dart'; // generated code can access "internal" functionality
- import 'package:objectbox/objectbox.dart';
- import 'package:objectbox_flutter_libs/objectbox_flutter_libs.dart';
- import 'entities/profile.dart';
- export 'package:objectbox/objectbox.dart'; // so that callers only have to import this file
- final _entities = <ModelEntity>[
- ModelEntity(
- id: const IdUid(2, 1438354990151910015),
- name: 'Profile',
- lastPropertyId: const IdUid(6, 4818206049188692305),
- flags: 0,
- properties: <ModelProperty>[
- ModelProperty(
- id: const IdUid(1, 3873481118333862410),
- name: 'id',
- type: 6,
- flags: 1),
- ModelProperty(
- id: const IdUid(2, 9078004558710481468),
- name: 'theme',
- type: 6,
- flags: 0),
- ModelProperty(
- id: const IdUid(3, 7647214962273172849),
- name: 'username',
- type: 9,
- flags: 0),
- ModelProperty(
- id: const IdUid(4, 5923665807684456265),
- name: 'isLogin',
- type: 1,
- flags: 0)
- ],
- relations: <ModelRelation>[],
- backlinks: <ModelBacklink>[])
- ];
- /// Open an ObjectBox store with the model declared in this file.
- Future<Store> openStore(
- {String? directory,
- int? maxDBSizeInKB,
- int? fileMode,
- int? maxReaders,
- bool queriesCaseSensitiveDefault = true,
- String? macosApplicationGroup}) async =>
- Store(getObjectBoxModel(),
- directory: directory ?? (await defaultStoreDirectory()).path,
- maxDBSizeInKB: maxDBSizeInKB,
- fileMode: fileMode,
- maxReaders: maxReaders,
- queriesCaseSensitiveDefault: queriesCaseSensitiveDefault,
- macosApplicationGroup: macosApplicationGroup);
- /// ObjectBox model definition, pass it to [Store] - Store(getObjectBoxModel())
- ModelDefinition getObjectBoxModel() {
- final model = ModelInfo(
- entities: _entities,
- lastEntityId: const IdUid(2, 1438354990151910015),
- lastIndexId: const IdUid(1, 2185831944762227781),
- lastRelationId: const IdUid(0, 0),
- lastSequenceId: const IdUid(0, 0),
- retiredEntityUids: const [3444477729893015694],
- retiredIndexUids: const [],
- retiredPropertyUids: const [
- 5463014948149082651,
- 2305308568754167021,
- 649621747167423523,
- 4818206049188692305
- ],
- retiredRelationUids: const [],
- modelVersion: 5,
- modelVersionParserMinimum: 5,
- version: 1);
- final bindings = <Type, EntityDefinition>{
- Profile: EntityDefinition<Profile>(
- model: _entities[0],
- toOneRelations: (Profile object) => [],
- toManyRelations: (Profile object) => {},
- getId: (Profile object) => object.id,
- setId: (Profile object, int id) {
- object.id = id;
- },
- objectToFB: (Profile object, fb.Builder fbb) {
- final usernameOffset = object.username == null
- ? null
- : fbb.writeString(object.username!);
- fbb.startTable(7);
- fbb.addInt64(0, object.id);
- fbb.addInt64(1, object.theme);
- fbb.addOffset(2, usernameOffset);
- fbb.addBool(3, object.isLogin);
- fbb.finish(fbb.endTable());
- return object.id;
- },
- objectFromFB: (Store store, ByteData fbData) {
- final buffer = fb.BufferContext(fbData);
- final rootOffset = buffer.derefObject(0);
- final object = Profile()
- ..id = const fb.Int64Reader().vTableGet(buffer, rootOffset, 4, 0)
- ..theme = const fb.Int64Reader().vTableGet(buffer, rootOffset, 6, 0)
- ..username =
- const fb.StringReader().vTableGetNullable(buffer, rootOffset, 8)
- ..isLogin =
- const fb.BoolReader().vTableGet(buffer, rootOffset, 10, false);
- return object;
- })
- };
- return ModelDefinition(model, bindings);
- }
- /// [Profile] entity fields to define ObjectBox queries.
- class Profile_ {
- /// see [Profile.id]
- static final id = QueryIntegerProperty<Profile>(_entities[0].properties[0]);
- /// see [Profile.theme]
- static final theme =
- QueryIntegerProperty<Profile>(_entities[0].properties[1]);
- /// see [Profile.username]
- static final username =
- QueryStringProperty<Profile>(_entities[0].properties[2]);
- /// see [Profile.isLogin]
- static final isLogin =
- QueryBooleanProperty<Profile>(_entities[0].properties[3]);
- }
|