Open TIMEMECHINEOO opened 14 hours ago
Can you share how you setup your dependency? My guess is that the ref you specified in you pubspec is old (dart2). You should switch to ref dart3a:
See the setup here https://github.com/tekartik/midi.dart?tab=readme-ov-file#setup and information about versioning
name: flutter_midi_text description: "A new Flutter project." publish_to: 'none' version: 0.1.0
environment: sdk: ^3.5.3
dependencies: flutter: sdk: flutter
dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^4.0.0 dependencies: tekartik_midi: path: /Users/Developer/midi.dart
flutter: uses-material-design: true
name: tekartik_midi version: 0.4.1 description: midi event and file parser publish_to: none
environment: sdk: ^3.5.3 dependencies: collection: ^1.15.0 tekartik_common_utils: git: url: https://github.com/tekartik/common_utils.dart ref: dart3a version: '>=0.10.7'
dev_dependencies: test: ^1.21.0 path: ^1.8.0 build_runner: '>=0.9.0' build_test: '>=0.10.2' process_run: '>=0.10.2' dev_build: '>0.13.1+1' build_web_compilers: '>=0.4.0'
I used git at first, but then because errors kept getting reported at the reference point, I changed it to local reference. I also updated all flutter and dart. I also checked the branch and it is applicable, but I couldn’t find the problem.And when quoting git, I will be prompted that your dependent packages and project names cannot be repeated. After I change it, other problems will occur.
Can you try using:
dependencies:
tekartik_midi:
git:
url: https://github.com/tekartik/midi.dart
ref: dart3a
I tried it. When I put the dart files under flutter, a lot of red wavy prompts will appear. I don't understand why. Even if I install the dependencies, it still can't be solved. like walking into a maze errors like these, it has146 lines. The name 'MidiEvent' is defined in the libraries 'file:///Users/Developer/TEST/flutter_midi_text/lib/src/midi/event.dart' and 'file:///Users/Developer/midi.dart/lib/src/midi/event.dart (via file:///Users/Developer/TEST/flutter_midi_text/lib/midi.dart)'. Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports.
It seems you have duplicated code. Try deleting duplicated files that you have copied (such as src/midi/event.dart and just include the git dependency and fix your import
The current Dart SDK version is 3.5.3.
Because flutter_midi_text depends on dependencies any which doesn't support null safety, version solving failed.
The lower bound of "sdk: '>=2.0.0 <3.0.0'" must be 2.12.0 or higher to enable null safety. For details, see https://dart.dev/null-safety