Flutter developer
6) What is AppLifecycleState?
AppLifecycleState is as follows:
inactive — The application is in an inactive state and is not receiving user input. (iOS only).
paused — The application is not currently visible to the user, not responding to user input, and running in the background.
resumed — The application is visible and responding to user input.
suspending — The application will be suspended momentarily. (Android only).
For more detail click here.
7) What is pubspec.yaml file?
It is responsible for handling importing images/fonts/third-party packages which you want to include in your project.
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 name, version, description, homepage, repository, documentation, dependencies, environment, and more about the pubspec.yaml file.
8) what is the difference between a flutter package and the flutter plugin.
A “package” contains only Dart code.
A “plugin” contains both Dart and Native code (kotlin/js/swift/…)
Flutter plugins: (Native-related developments).
Flutter plugin is the wrapper of the native code like android( Kotlin or java) and iOS(swift or objective c)
Flutter can do anything that a native application can through the use of Platform Channels and Message Passing. Flutter instructs the native iOS/Android code to act and returns the result to Dart.
Flutter packages or modules: (Make the development faster by using code from util libraries).
Flutter supports using shared packages contributed by other developers to the Flutter and Dart ecosystems. This allows for quickly building an app without having to develop everything from scratch.
A package can use plugins if it wants to. It will still qualify as a package.
9) What is the difference between WidgetsApp and MaterialApp?
WidgetsApp:- A convenience class that wraps several widgets that are commonly required for an application.
One of the primary roles that WidgetsApp provides is binding the system back button to pop the Navigator or quitting the application.
MaterialApp:- A convenience widget that wraps several widgets that are commonly required for material design applications.
It builds upon a WidgetsApp by adding material-design specific functionality, such as AnimatedTheme and GridPaper.
10) What’s the difference between hot reload and hot restart?
In simple words,
Hot Reload is just updating the changes in your program.
But Hot Restart will again remove your previous state and run the complete program.
Hot Reload
Flutter hot reload features works with a combination of the Small r key on the command prompt or Terminal.
The hot reload feature quickly compile the newly added code in our file and sent the code to Dart Virtual Machine. After done updating the Code Dart Virtual Machine update the app UI with widgets.
Hot Reload takes less time than Hot restart.
There is also a drawback in Hot Reload, If you are using States in your application then Hot Reload preservers the States so they will not update on Hot Reload our set to their default values.
Hot Restart
A hot restart is much different from a hot reload.
In Hot restart, it destroys the preserved State value and set them to their default. So if you are using state value in your application then after every hot restart the developer gets a fully compiled application and all the states will be set to their defaults.
The app widget tree is completely rebuilt with a new type of code.
Hot Restart takes much higher time than Hot reload.
Top 100 Flutter Interview Questions
Visit my Page
Click here to claim your Sponsored Listing.
Category
Contact the school
Telephone
Address
Peshawar
25000