Skip to content

Nitrite/Flutter: Getting an error creating an ObjectRepository #51

Discussion options

You must be logged in to vote

Thanks for trying out Nitrite. Here is the code that would work in your case.

import 'dart:io';

import 'package:faker/faker.dart';
import 'package:nitrite/nitrite.dart';
import 'package:nitrite_hive_adapter/nitrite_hive_adapter.dart';

part 'github_test.no2.dart'; // <-- generated file

@Convertable()
@Entity()
class Todo with _$TodoEntityMixin {
  @Id()
  final String id;
  final Properties? properties;

  Todo({
    required this.id,
    this.properties,
  });

  @override
  String toString() {
    return 'Todo{id: $id, properties: $properties}';
  }
}

@Convertable()
class Properties {
  final String id;
  final Map<String, dynamic> locations;

  Properties({
    required this.id,
    r…

Replies: 5 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by 381outrageousDoors
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@anidotnet
Comment options

@anidotnet
Comment options

@anidotnet
Comment options

Comment options

You must be logged in to vote
1 reply
@anidotnet
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants