didChangeDependencies()

The didChangeDependencies method in Flutter is part of the widget lifecycle. It is called whenever the widget’s dependencies change, such as when an inherited widget that the widget relies on is modified. This method is useful for when you need to update state or fetch resources based on changes in the widget tree’s dependencies. When is didChangeDependencies Called? After the first time […]

person shubham sharmaaccess_time October 16, 2024launch Read More

didUpdateWidget()

The didUpdateWidget() method in Flutter is called when the parent widget rebuilds and the current widget is updated with new configuration data (i.e., new props or properties). This method is especially useful when you want to respond to changes in the data passed down from a parent widget but do not want to completely rebuild […]

person shubham sharmaaccess_time October 16, 2024launch Read More

Which thread MethodChannel use?

In Flutter, the MethodChannel communication between Flutter (Dart) and the native platform (Android/iOS) involves both Flutter’s thread and the native platform’s threads. The threads used for MethodChannel operations depend on how the method calls are invoked and handled. Threads Used by MethodChannel: Flutter Side (Dart Thread): When you call MethodChannel.invokeMethod() from Flutter, it runs on […]

person shubham sharmaaccess_time October 16, 2024launch Read More

What is MethodChannel flutter?

In Flutter, a MethodChannel is a way to communicate between Flutter’s Dart code and the platform-specific (native) code, such as Android (Kotlin/Java) or iOS (Swift/Objective-C). It is used to call methods and exchange data between Flutter and the native platform. This is necessary when you want to access platform-specific features that are not directly available through Flutter’s libraries (e.g., […]

person shubham sharmaaccess_time October 16, 2024launch Read More

What is hash map?

A hash map (also known as a hash table) is a data structure that stores key-value pairs, allowing for efficient data retrieval based on keys. It is widely used for fast lookups, insertions, and deletions. Key Concepts of a Hash Map: Key-Value Pair: Each element in a hash map is stored as a pair, consisting […]

person shubham sharmaaccess_time October 15, 2024launch Read More

is Isolates equal to java thread?

Isolates and Java threads share similarities, but they are not equal. Here’s a comparison: Similarities: Concurrency: Both isolates and threads enable concurrent execution of code. Separate execution: Both run independently, without blocking each other. Communication: Both allow communication between concurrent units (via messaging or shared state). Differences: Memory model: Isolates have separate heaps, while threads […]

person shubham sharmaaccess_time October 15, 2024launch Read More

What is const widget?

What is a const Widget in Flutter? In Flutter, the const keyword is used to create constant widgets, which are widgets that do not change during the app’s runtime. A const widget is a compile-time constant, meaning its properties are fixed when the app is compiled, and it does not need to be recreated or […]

person shubham sharmaaccess_time October 15, 2024launch Read More

Explain the concept of futures and streams in Dart.

In Dart, futures and streams are fundamental concepts used for asynchronous programming. They provide a way to handle operations that may not immediately return a result, such as network requests, file I/O, or computations that take time to complete. Futures: Definition: A future represents a potential value or error that will be available at some […]

person shubham sharmaaccess_time February 22, 2024launch Read More

Isolates and Event Loops – Flutter

Isolates in Flutter In Flutter, isolates are a feature of the Dart language, which Flutter is built on. Isolates allow for concurrent execution of Dart code, enabling tasks to run in parallel without blocking the main UI thread. How many Isolates Flutter have in default In Flutter, by default, there is a single UI isolate […]

person shubham sharmaaccess_time February 18, 2024launch Read More

What is lifecycle of widget?

Understanding the widget lifecycle in Flutter is crucial for managing the state of your widgets effectively, especially when dealing with stateful widgets. Flutter provides several lifecycle methods that allow you to respond to changes in your widget’s state, from creation to destruction. Here’s a comprehensive example illustrating the lifecycle of a stateful widget with explanations […]

person shubham sharmaaccess_time September 20, 2023launch Read More