A Flotcha worth mentioning

Time and again I encountered this error in flutter ever confused on how to solve it:

compiler message: lib/splash_screen.dart:69:28: Error: A value of type '#lib1::RiteKey' can't be assigned to a variable of type '#lib2::RiteKey'. compiler message: Try changing the type of the left hand side, or casting the right hand side to '#lib2::RiteKey'. compiler message:                   riteKey: riteKey, compiler message:                            ^ Error -32000 received from application: There are no running service protocol handlers.

This #lib1:Object #lib2:Object error was quite frustrating because there wasn’t much we were doing wrong…

I don’t know the details but this was finally solved 2 days ago on Stack Overflow(pseudo heaven for devs who get stuck)

well read the discussion and you see that the team is already on it!
This is the issue to track:

So what do we need to do?

->Don’t use relative paths to import files in main.dart

Use absolute paths starting from the package name itself. Like:

import 'package:startup_namer/utils/question.dart';
import 'package:startup_namer/utils/quiz.dart';
import 'package:startup_namer/ui/answer_button.dart';
import 'package:startup_namer/ui/correct_wrong_overlay.dart';

And that’s it! Wishing that all your code compiles and runs well,
Raveesh Signing off!
(BTW Flutter+Gotcha = Flotcha!!)

Entrepreneur, software craftsman and technology enthusiast, I continue to solve problems and grow with my projects, partnerships and endeavors.

Entrepreneur, software craftsman and technology enthusiast, I continue to solve problems and grow with my projects, partnerships and endeavors.