What is the difference between final, const, and static in Dart?
final means assigned once at runtime; const means assigned at compile-time (deeply immutable); static means...
25 questions
Null safety, async, isolates, Dart 3 features
final means assigned once at runtime; const means assigned at compile-time (deeply immutable); static means...
Dart's sound null safety means non-nullable types can never be null at runtime — the compiler enforces this...
Dart is single-threaded with an event loop. async/await syntactic sugar wraps code in Future continuations....
A Dart Stream is an asynchronous sequence of events. Single-subscription streams (default) allow only one l...
Isolates are Dart's concurrency primitive — independent workers with their own memory heap. They communicat...
Mixins allow sharing methods across class hierarchies without inheritance. The 'on' keyword restricts which...
Extension methods add new methods to existing types without subclassing or wrapping. They're resolved stati...
Factory constructors can return existing instances (caching/singleton), return subtype instances (polymorph...
Dart generics use type parameters <T> for type-safe collections and classes. Bounded generics <T extends So...
Dart 3 Records are anonymous, immutable value types that group multiple values. Pattern matching in switch ...
Sealed classes restrict which classes can extend them (only within the same library). This gives the compil...
Dart 2.17+ enhanced enums can have fields, constructors, methods, and implement interfaces — making them fu...
late defers initialization of a non-nullable variable — it must be initialized before first access (runtime...
The cascade operator (..) allows chaining multiple operations on the same object without repeating the vari...
The spread operator (...) flattens an iterable into a list/set/map literal. Collection if adds elements con...
typedef creates a named alias for function types or complex generic types, improving code readability and a...
Override both == and hashCode together — they form a contract. Objects that are == must have the same hashC...
Zones provide a context for asynchronous code that allows overriding behaviors like error handling, schedul...
var uses type inference (becomes the inferred type); dynamic opts out of type checking entirely; Object is ...
Every Dart class is implicitly an interface. abstract classes define contracts + optional implementations; ...
Positional parameters are passed by position; named parameters are passed by name (in braces); required key...
Dart's event loop runs in a single thread: execute sync code → drain microtask queue completely → process o...
The fat arrow => is syntactic sugar for a single-expression function body: int add(int a, int b) => a + b; ...
List: O(1) index access, O(n) search; Set/Map (hash-based): O(1) lookup/insert/delete on average. Use Set w...
Dart uses $variable or ${expression} for string interpolation, triple quotes for multiline strings (''' or ...