From 59bacadee90d1631e7cf3d27bdfde539d7363636 Mon Sep 17 00:00:00 2001 From: Uwe <13865709+greenrobot-team@users.noreply.github.com> Date: Tue, 10 Sep 2024 12:10:53 +0200 Subject: [PATCH] Do not import generated class in model classes 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. --- generator/integration-tests/basics/lib/lib.dart | 1 - generator/integration-tests/final/lib/lib.dart | 2 -- generator/integration-tests/getters/lib/lib.dart | 2 -- generator/integration-tests/indexes/lib/lib.dart | 1 - generator/integration-tests/relations/lib/lib.dart | 1 - .../event_management_tutorial/event_manager/lib/model.dart | 1 - .../event_management_tutorial/many_to_many/lib/model.dart | 1 - objectbox/example/flutter/objectbox_demo/lib/model.dart | 2 -- .../example/flutter/objectbox_demo_relations/lib/model.dart | 2 -- objectbox/example/flutter/objectbox_demo_sync/lib/model.dart | 2 -- 10 files changed, 15 deletions(-) diff --git a/generator/integration-tests/basics/lib/lib.dart b/generator/integration-tests/basics/lib/lib.dart index d612ae6a9..b68ded354 100644 --- a/generator/integration-tests/basics/lib/lib.dart +++ b/generator/integration-tests/basics/lib/lib.dart @@ -1,7 +1,6 @@ import 'dart:typed_data'; import 'package:objectbox/objectbox.dart'; -import 'objectbox.g.dart'; export 'other.dart'; @Entity() diff --git a/generator/integration-tests/final/lib/lib.dart b/generator/integration-tests/final/lib/lib.dart index 005749fc0..3fbd85c76 100644 --- a/generator/integration-tests/final/lib/lib.dart +++ b/generator/integration-tests/final/lib/lib.dart @@ -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 { diff --git a/generator/integration-tests/getters/lib/lib.dart b/generator/integration-tests/getters/lib/lib.dart index e4de13078..e71247d40 100644 --- a/generator/integration-tests/getters/lib/lib.dart +++ b/generator/integration-tests/getters/lib/lib.dart @@ -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() diff --git a/generator/integration-tests/indexes/lib/lib.dart b/generator/integration-tests/indexes/lib/lib.dart index 4ea7563c9..275ff341a 100644 --- a/generator/integration-tests/indexes/lib/lib.dart +++ b/generator/integration-tests/indexes/lib/lib.dart @@ -1,5 +1,4 @@ import 'package:objectbox/objectbox.dart'; -import 'objectbox.g.dart'; @Entity() class A { diff --git a/generator/integration-tests/relations/lib/lib.dart b/generator/integration-tests/relations/lib/lib.dart index 124dcd9fb..1e33acb63 100644 --- a/generator/integration-tests/relations/lib/lib.dart +++ b/generator/integration-tests/relations/lib/lib.dart @@ -1,5 +1,4 @@ import 'package:objectbox/objectbox.dart'; -import 'objectbox.g.dart'; @Entity() class A { diff --git a/objectbox/example/flutter/event_management_tutorial/event_manager/lib/model.dart b/objectbox/example/flutter/event_management_tutorial/event_manager/lib/model.dart index 374f8a600..8ce0fb1f3 100644 --- a/objectbox/example/flutter/event_management_tutorial/event_manager/lib/model.dart +++ b/objectbox/example/flutter/event_management_tutorial/event_manager/lib/model.dart @@ -1,5 +1,4 @@ import 'package:objectbox/objectbox.dart'; -import 'objectbox.g.dart'; @Entity() class Task { diff --git a/objectbox/example/flutter/event_management_tutorial/many_to_many/lib/model.dart b/objectbox/example/flutter/event_management_tutorial/many_to_many/lib/model.dart index e6dc1166b..74b7d18c5 100644 --- a/objectbox/example/flutter/event_management_tutorial/many_to_many/lib/model.dart +++ b/objectbox/example/flutter/event_management_tutorial/many_to_many/lib/model.dart @@ -1,5 +1,4 @@ import 'package:objectbox/objectbox.dart'; -import 'objectbox.g.dart'; @Entity() class Task { diff --git a/objectbox/example/flutter/objectbox_demo/lib/model.dart b/objectbox/example/flutter/objectbox_demo/lib/model.dart index dbd3061ad..bce1ba2ad 100644 --- a/objectbox/example/flutter/objectbox_demo/lib/model.dart +++ b/objectbox/example/flutter/objectbox_demo/lib/model.dart @@ -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() diff --git a/objectbox/example/flutter/objectbox_demo_relations/lib/model.dart b/objectbox/example/flutter/objectbox_demo_relations/lib/model.dart index 3ba1ecc76..56e745263 100644 --- a/objectbox/example/flutter/objectbox_demo_relations/lib/model.dart +++ b/objectbox/example/flutter/objectbox_demo_relations/lib/model.dart @@ -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' diff --git a/objectbox/example/flutter/objectbox_demo_sync/lib/model.dart b/objectbox/example/flutter/objectbox_demo_sync/lib/model.dart index c5adfa8e4..073dd13e4 100644 --- a/objectbox/example/flutter/objectbox_demo_sync/lib/model.dart +++ b/objectbox/example/flutter/objectbox_demo_sync/lib/model.dart @@ -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()