Skip to content

freezed missing implementations #289

@drexhacker

Description

@drexhacker

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions