❓ What can and what can't be transferred as message between Isolates?
Any primitive data (null, num, bool, double, String), Instances of SendPort, lists and maps.
Callbacks, Futures aren't allowed because they aren't serializable.
Every dart code runs in a Zone. It connects the code to the underlying system. It handles async code, allows scheduling of microtasks and timers. And makes sure apps don't crash by catching errors.
All that behavior can be overridden, which is interesting.
❓ How do you cancel a Future?
You can't. You can only prevent a Future from returning any value by wrapping it in a CancelableOperation. Once cancel() is called the execution stops eventually and might complete entirely. pub.dev/documentation/…
❓ How do you call js from dart?
Assuming the dart code is compiled to js, dart:js is the solution. It's straightforward to use, but not typesafe in any way. api.dart.dev/stable/2.10.5/…
❓ How do you test code using DateTime#now()
Use the clock package together with fake_async.
Replace DateTime#now() with clock#now() returning a time that can be adjusted with fakeAsync in milliseconds.
Please don't feel stupid when you can't answer any of those questions. They are very specific and you might never run into cases where this knowledge is useful.
Topics you should really prepare for I might aks in your #FlutterDev interviews are:
- What does setState?
- Have you ever written unit tests?
- Why do you prefer Flutter over Android/RN/web
- Do you have experience writing plugins?
- Have you worked on open-source projects?
Contact me if you're interested in practicing your interview or you want to apply for a position at @phntmxyz 😉
• • •
Missing some Tweet in this thread? You can try to
force a refresh