Flutter interview question Q6 -Q20

6) List different types of widgets available in Flutter?


Two types of widgets present in the Flutter are stateless and stateful.
The stateless widgets don’t store any values which will change in the future. The stateless widgets don’t store any state. Icon, text widgets are some examples of stateless widgets.
The stateful widgets have a state object to keep track of all the changes and updates happening in the UI. These widgets are immutable but the state object is used to keep track of the changes. Checkbox and image are some of the examples of stateful widgets.

7) Talk about different build modes in Flutter?


The three different types of build modes in Flutter are DebugRelease, and Profile.
Debug mode is used to debug the application on the physical device, emulator, or simulator. Here, assertions, service extensions are enabled. Then compilation is optimized for fast deployment.
Release mode is enabled to deploy your app. Here, assertions, service extension and debugging are disabled. Finally, the compilation is optimized for fast startup, execution, and package sizes.
Profile mode is used to analyze the performance of your app. Here, some extensions and tracing are enabled.

8) List the companies who using Flutter?


Some companies that use Flutter are
  • realtor.com,
  • Tencent,
  • the new york times,
  • square,
  • google,
  • eBay,
  • Sonos,
  • BMW,
  • Emaar,
  • Groupon, and capital one.

9) What is Hot Reload in Flutter?


A hot reload feature is used to quickly reload the changes code on your running app. With this feature, you can quickly and easily experiment, change UIs, add features, and more fix bugs on your application. This feature works by injecting the changed source code into the running Dart Virtual Machine. Then, Flutter automatically rebuilds the widget tree so you can quickly view the changed effects.

10) What is tree shaking in Flutter?


Tree shaking is an optimization technique to remove the unused module in the bundle during the build process. It is a dead code elimination technique used to optimize the code.


11) What is a Spacer widget?


The Spacer class is used to create an adjustable, empty space. This empty space is used to manage the space between the widgets with the flex container. Spacer takes flex in the constructor to define the space.

12) What is use of pubspec.yaml file?


The pubspec.yaml file is used to define the dependencies of your Flutter project. This metadata information is written in the YAML language. This file can have the following fields such as the name, version, description, homepage, repository, documentation, dependencies, environment, and more about the pubspec.yaml file.

13) What is context in flutter?


Context is a handle to the location of the widget in the widget tree. It is a BuildContext instance that gets passed to the builder of a widget in order to know where it is inside the widget tree. It is nothing but a reference to the location of a Widget within the tree structure of all the built widgets.

14) what are DevTools in flutter?


DevTools in Flutter are a set of tools used for performance management and debugging. With these tools, you can inspect the UI layout, diagnose the UI performance issues, perform source-level debugging, view general log & diagnostics information, and more. This tool is still in preview release but you can test the alpha version of this tool by clicking the "beaker" icon in the upper-right corner of DevTools.

15) What is Flutter native?


Flutter is relatively a new framework used to build natively compiled applications for different platforms such as iOSAndroidweb, and desktop. It can be used in place of React Native as React is too reliant on third-party libraries. So flutter can be used if you need more native modules.

16) What is Flex box in Flutter?


The Flex class in Flutter is used to display its children in a one-dimensional array. With this widget, you can control the axis where the children are placed. This axis is called as the main axis.

17) What are staggered Animations?


Staggered animation utilizes few animation items to include consecutive or covering animations. An animation controller is used to control all the animations. You can use multiple animation objects to create staggered animations and each animation object specifies the animation during the interval. It is a straightforward approach to create visual changes in a series of operations rather than all at once.

18) What is use of http package in Flutter?


The HTTP package is used in the Flutter project to provide a simple way to fetch data from the Internet. You can use the HTTP package by just adding it to the pubspec.yaml package.

19) What are Packages in Flutter?


Packages are used to quickly build an application without developing everything from scratch.
Some example packages are HTTP (for network request)fluro (custom navigation/ route handling), and more.
You can install the package by specifying it in the pubspec.yaml file. You can also create your own package and share it with others.

20) What is use of Navigation.push and Navigation.pop function?


The push method is used to add a route to the stack of routes managed by the navigator. The pop method is used to remove the current route from the stack of routes managed by the navigator.

Comments