Q: How to share Data Object between two Flutter apps? (e.g. App + Web) I have a Data Object put in a firebase database.
import 'dart:typed_data';
import 'package:json_annotation/json_annotation.dart';
part 'artifact.g.dart';

@JsonEnum()
enum ArtifactType { unknown, video, image }

@JsonSerializable(explicitToJson: true)
class Artifact {
  ArtifactType artifactType = ArtifactType.unknown;
  String? artifactBasename;

  Artifact();

  factory Artifact.fromJson(Map<String, dynamic> json) =>
      _$ArtifactFromJson(json);

  Map<String, dynamic> toJson() => _$ArtifactToJson(this);
}

This class shall now be used to create objects by
-> CreateArtifact App on iOS/Android
and the objects become consumed and shown with the
-> ShowArtifact Web Application (hosted on Firebase)
As you see, the dart file is being used to generate another dart file for the json serialization by the json-build runner.
Currently, I have the artifact.dart class on both projects and copy the source code between them upon any change on either side.
However, the correct way would be a common "library" for the artifact.dart.
Of course, the library should not become published to pub.dev, it´s private and local only.
What is the correct way to organize a shared dart file between both flutter projects, e.g. using Android Studio?
Thanks!
