diff --git a/docs/docs/de/tutorials/quickstart.md b/docs/docs/de/tutorials/quickstart.md index 673165acc..c0cdde976 100644 --- a/docs/docs/de/tutorials/quickstart.md +++ b/docs/docs/de/tutorials/quickstart.md @@ -13,8 +13,7 @@ Dieser Schnellstart wird wenig um den heißen Brei herumreden und direkt mit dem Bevor es losgeht, müssen wir ein paar Pakete zur `pubspec.yaml` hinzufügen. Damit es schneller geht lassen wir pub das für uns erledigen. ```bash -flutter pub add isar isar_flutter_libs -flutter pub add -d isar_generator build_runner +dart pub add isar:^4.0.0-dev.15 isar_flutter_libs:^4.0.0-dev.15 --hosted-url=https://isar-community.dev ``` ## 2. Klassen annotieren @@ -26,7 +25,7 @@ part 'user.g.dart'; @collection class User { - Id id = Isar.autoIncrement; // Für auto-increment kannst du auch id = null zuweisen + late int id; // Für auto-increment kannst du auch id = null zuweisen String? name; @@ -36,21 +35,7 @@ class User { IDs identifizieren Objekte in einer Collection eindeutig und erlauben es dir, sie später wiederzufinden. -## 3. Code-Generator ausführen - -Führe den folgenden Befehl aus, um den `build_runner` zu starten: - -``` -dart run build_runner build -``` - -Wenn du Flutter verwendest: - -``` -flutter pub run build_runner build -``` - -## 4. Isar-Instanz öffnen +## 3. Isar-Instanz öffnen Öffne eine neue Isar-Instanz und übergebe alle Collection-Schemata. Optional kannst du einen Instanznamen und ein Verzeichnis angeben. @@ -62,7 +47,7 @@ final isar = await Isar.open( ); ``` -## 5. Schreiben und lesen +## 4. Schreiben und lesen Wenn deine Instanz geöffnet ist, hast du Zugriff auf die Collections. @@ -72,6 +57,7 @@ Alle grundlegenden CRUD-Operationen sind über die `IsarCollection` verfügbar . final newUser = User()..name = 'Jane Doe'..age = 36; await isar.writeTxn(() async { + newUser.id = isar.users.autoIncrement(); await isar.users.put(newUser); // Einfügen & akualisieren }); diff --git a/docs/docs/tutorials/quickstart.md b/docs/docs/tutorials/quickstart.md index 90fabe376..37e4acc0b 100644 --- a/docs/docs/tutorials/quickstart.md +++ b/docs/docs/tutorials/quickstart.md @@ -13,8 +13,7 @@ We're going to be short on words and quick on code in this quickstart. Before the fun begins, we need to add a few packages to the `pubspec.yaml`. We can use pub to do the heavy lifting for us. ```bash -flutter pub add isar isar_flutter_libs path_provider -flutter pub add -d isar_generator build_runner +dart pub add isar:^4.0.0-dev.15 isar_flutter_libs:^4.0.0-dev.15 --hosted-url=https://isar-community.dev ``` ## 2. Annotate classes @@ -28,7 +27,7 @@ part 'user.g.dart'; @collection class User { - Id id = Isar.autoIncrement; // you can also use id = null to auto increment + late int id; String? name; @@ -38,21 +37,7 @@ class User { Ids uniquely identify objects in a collection and allow you to find them again later. -## 3. Run code generator - -Execute the following command to start the `build_runner`: - -``` -dart run build_runner build -``` - -If you are using Flutter, use the following: - -``` -flutter pub run build_runner build -``` - -## 4. Open Isar instance +## 3. Open Isar instance Open a new Isar instance and pass all of your collection schemas. Optionally you can specify an instance name and directory. @@ -64,7 +49,7 @@ final isar = await Isar.open( ); ``` -## 5. Write and read +## 4. Write and read Once your instance is open, you can start using the collections. @@ -74,6 +59,7 @@ All basic CRUD operations are available via the `IsarCollection`. final newUser = User()..name = 'Jane Doe'..age = 36; await isar.writeTxn(() async { + newUser.id = isar.users.autoIncrement(); await isar.users.put(newUser); // insert & update });