0

My project has 3 sub-project including

  • dart_server
  • flutter_app
  • share

The share project is about objects, config, and paths, ... which was used in the dart_server and flutter_app projects.

In the share project. Some objects contain a package used for the flutter like the [get][1] package and this object is used for both projects (dart_server and flutter_app). When using this object in the dart_server project, it will error and the terminal will show an error too long.

error example:

/C:/src/flutter/packages/flutter/lib/src/gestures/velocity_tracker.dart:299:35: Error: Type 'Offset' not found.
  void addPosition(Duration time, Offset position) {
                                  ^^^^^^
/C:/src/flutter/packages/flutter/lib/src/gestures/velocity_tracker.dart:317:3: Error: Type 'Offset' not found.
  Offset _previousVelocityAt(int index) {
  ^^^^^^
/C:/src/flutter/packages/flutter/lib/src/gestures/velocity_tracker.dart:24:58: Error: Undefined name 'Offset'.
  static const Velocity zero = Velocity(pixelsPerSecond: Offset.zero);
                                                         ^^^^^^
/C:/src/flutter/packages/flutter/lib/src/gestures/velocity_tracker.dart:27:9: Error: 'Offset' isn't a type.
  final Offset pixelsPerSecond;
        ^^^^^^

This can reproduce by creating a dart server project and import any package for the flutter like [get][1] in the file that will run and run this server by dart run.

How to use this object that contains packages for the flutter app?

0 Answers0