Skip to content

Commit

Permalink
Do not import generated class in model classes
Browse files Browse the repository at this point in the history
It's not necessary and can lead to issues with other build runners that
can't find the yet to be generated import. So don't do it in the repo
to avoid it being interpreted as best practice.
  • Loading branch information
greenrobot-team committed Sep 10, 2024
1 parent 2dc4caf commit 59bacad
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 15 deletions.
1 change: 0 additions & 1 deletion generator/integration-tests/basics/lib/lib.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:typed_data';

import 'package:objectbox/objectbox.dart';
import 'objectbox.g.dart';
export 'other.dart';

@Entity()
Expand Down
2 changes: 0 additions & 2 deletions generator/integration-tests/final/lib/lib.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import 'dart:typed_data';

import 'package:objectbox/objectbox.dart';

import 'objectbox.g.dart';

// Test all final fields; Id must be self-assigned.
@Entity()
class A {
Expand Down
2 changes: 0 additions & 2 deletions generator/integration-tests/getters/lib/lib.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:objectbox/objectbox.dart';

import 'objectbox.g.dart';

/// Test annotations on getters are applied to properties when using
/// getter + setter combos to create synthetic fields.
@Entity()
Expand Down
1 change: 0 additions & 1 deletion generator/integration-tests/indexes/lib/lib.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:objectbox/objectbox.dart';
import 'objectbox.g.dart';

@Entity()
class A {
Expand Down
1 change: 0 additions & 1 deletion generator/integration-tests/relations/lib/lib.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:objectbox/objectbox.dart';
import 'objectbox.g.dart';

@Entity()
class A {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:objectbox/objectbox.dart';
import 'objectbox.g.dart';

@Entity()
class Task {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:objectbox/objectbox.dart';
import 'objectbox.g.dart';

@Entity()
class Task {
Expand Down
2 changes: 0 additions & 2 deletions objectbox/example/flutter/objectbox_demo/lib/model.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:intl/intl.dart';
import 'package:objectbox/objectbox.dart';

import 'objectbox.g.dart';

// ignore_for_file: public_member_api_docs

@Entity()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:intl/intl.dart';
import 'package:objectbox/objectbox.dart';

import 'objectbox.g.dart';

@Entity() // Signals ObjectBox to create a Box for this class.
class Tag {
// Every @Entity requires an int property named 'id'
Expand Down
2 changes: 0 additions & 2 deletions objectbox/example/flutter/objectbox_demo_sync/lib/model.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import 'package:intl/intl.dart';
import 'package:objectbox/objectbox.dart';

import 'objectbox.g.dart';

// ignore_for_file: public_member_api_docs

@Entity()
Expand Down

0 comments on commit 59bacad

Please sign in to comment.