0

I'm trying to share objects between a client-side and server-side project. Currently the way I thought of doing it was by adding a 3rd project called "shared" and put my common classes inside.

But now when I run my client-side-project by referencing files like this:

import '../../../shared/game.dart';

I get a warning from pub saying

[Error from InjectorGenerator on client|web/main.dart]: Could not load asset client|../shared/game.dart

Is there a way to either publish locally my shared project to reference the classes with the import packages:... syntax? Otherwise, what's the way of doing this in Dart?

Pacane
  • 20,273
  • 18
  • 60
  • 97

0 Answers0