-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
Hey @frank06 thanks for the great work. am having a small issue here trying to use freezed with flutter_data. Here is the log
lib/models/business.freezed.dart:231:7: Error: The non-abstract class '_$BusinessImpl' is missing implementations
for these members:
- _DataModel&Object&DataModelMixin.init
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class _$BusinessImpl implements _Business {
^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/flutter_data-1.6.0/lib/src/model/data_model.dart:86:5: Context: 'Object with
DataModelMixin.init' is defined here.
T init() {
^^^^
And here is my DataModel
import 'package:flutter_data/flutter_data.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:meno/adapters/appwrite.dart';
import 'package:meno/models/location.dart';
part 'business.freezed.dart';
part 'business.g.dart';
@freezed
@DataRepository([AppwriteAdapter])
class Business extends DataModel<Business> with _$Business {
factory Business({
@override String? id,
required String name,
required String ownerId,
required String teamId,
String? businessType,
String? address,
String? phone,
String? email,
HasMany<Location>? locations,
DateTime? createdAt,
DateTime? updatedAt,
}) = _Business;
factory Business.fromJson(Map<String, dynamic> json) =>
_$BusinessFromJson(json);
}Thanks in advance for any support. And by the way json_serializable is working well, so I just wanted to have extra features of freezed
Metadata
Metadata
Assignees
Labels
No labels