Sunday, July 9, 2023

Android 13 Features

Personalization: Android 13 introduces a new design language called Material You, which allows you to customize the look and feel of your Android device, including your wallpaper, icons, and other elements.

Privacy and security: Android 13 includes a number of new privacy and security features, such as the ability to give apps one-time permissions, the ability to see which apps have access to your microphone and camera, and the ability to require a password to access your phone when it is locked.

Media and entertainment: Android 13 includes a number of new media and entertainment features, such as the ability to stream media to nearby devices, the ability to control media playback from your lock screen, and the ability to create custom audio profiles.

Productivity: Android 13 includes a number of new productivity features, such as the ability to use multiple languages in the same app, the ability to copy and paste text from one app to another, and the ability to take screenshots of entire pages.

Accessibility: Android 13 includes a number of new accessibility features, such as the ability to use your voice to control your phone, the ability to magnify the screen, and the ability to change the color scheme of your phone.


Here are some of the other notable features of Android 13:

New media controls: Android 13 introduces new media controls that are more intuitive and easier to use. The new controls are always visible at the top of the screen, and they can be customized to show the media you are currently listening to or watching.

Per-app language preferences: Android 13 allows you to set different language preferences for different apps. This means that you can use one language for your email app, another language for your social media app, and so on.

Photo picker: Android 13 introduces a new photo picker that gives you more control over the images and videos you share with apps. The new picker allows you to select specific images or videos, or to share the entire contents of your gallery.

Notification permissions: Android 13 gives you more control over the notifications you receive from apps. You can now choose which apps can send you notifications, and you can also choose how often you want to receive notifications from each app.

Clipboard history: Android 13 keeps a history of the text you have copied to your clipboard. This means that you can easily paste text that you copied a long time ago, even if you have since closed the app that you copied it from.

For more details please click here.

Monday, July 3, 2023

101 Corda Questions And Answers

What is Corda?
Corda is an open-source blockchain platform designed for developing and executing smart contracts within the financial services industry.

How does Corda differ from other blockchain platforms?
Corda differs from other blockchain platforms in several ways. It emphasizes privacy and data confidentiality, focuses on the needs of businesses in the financial industry, and provides a flexible architecture for developing decentralized applications.

What are the key components of a Corda network?
The key components of a Corda network include nodes, notaries, the network map, and the Corda firewall.

How does Corda handle privacy in transaction data?
Corda employs a technique called "transaction tear-offs" to ensure privacy. Only the relevant parties involved in a transaction can access the transaction data, unlike traditional blockchain platforms where transaction data is visible to all participants.

What is the role of notaries in Corda?
Notaries in Corda are responsible for validating and ordering transactions. They prevent double-spending and provide consensus on the ordering and uniqueness of transactions.

Can you explain the concept of "state" in Corda?
In Corda, a state represents a shared fact between parties involved in a transaction. It holds the data associated with a specific agreement or contract.

What is the Corda Vault?
The Corda Vault is a storage mechanism in Corda that securely stores and manages states. It ensures that states are accessible only to the parties involved in the transaction.

How does Corda handle interoperability with existing systems?
Corda provides various APIs and libraries to integrate with existing systems. It supports interoperability through standard protocols and formats, allowing seamless data exchange.

What programming languages can be used to develop applications on Corda?
Corda primarily supports programming languages like Java and Kotlin. However, developers can use other JVM languages to write Corda applications.

How does Corda handle transaction finality?
Corda achieves transaction finality through the concept of "notarization." Once a transaction is notarized, it is considered immutable and cannot be reversed.

What is the role of the Corda Service Bus?
The Corda Service Bus facilitates communication between nodes in a Corda network. It handles message routing, queuing, and peer-to-peer communication.

How does Corda handle identity management?
Corda uses a decentralized identity model. Participants in the network have unique public/private key pairs, which are used for identity verification and transaction authorization.

Can Corda support non-financial applications?
Yes, Corda is not limited to financial applications. It can be used in various other industries such as supply chain, healthcare, insurance, and more.

How does Corda handle regulatory compliance?
Corda provides built-in regulatory and legal constructs to meet compliance requirements. It allows for the enforcement of rules and regulations within smart contracts.

Can Corda be deployed on public blockchains?
Corda is primarily designed for permissioned networks. However, it can interact with public blockchains through oracles or other integration mechanisms.

How does Corda handle scalability?
Corda achieves scalability by allowing transaction verification to be performed only by the involved parties. This reduces the network's computational burden and increases throughput.

What is the significance of the Corda flows framework?
The Corda flows framework allows developers to define complex transaction workflows. It handles communication, negotiation, and validation between parties involved in a transaction.

What is the role of the Corda Network?
The Corda Network is a permissioned network of Corda nodes operated by various organizations. It allows for secure and private communication between different Corda participants.

How does Corda handle consensus among participants?
Corda achieves consensus through a combination of notarization, validation, and contract verification. All participants agree on the outcome of a transaction based on these processes.

How does Corda handle fault tolerance and resilience?
Corda provides fault tolerance through its consensus algorithm and the ability to recover from node failures. Nodes can rejoin the network after failure and synchronize their states.

How does Corda handle data storage?
Corda uses a combination of local databases and distributed ledger technology. It stores transaction data in a transaction log and state data in a local database.

Can Corda support cross-border transactions?
Yes, Corda can support cross-border transactions. Its privacy and security features make it suitable for handling transactions across different jurisdictions.

What is the Corda Firewall?
The Corda Firewall is a security feature that allows nodes to control access to their services. It prevents unauthorized access to the node's APIs and restricts communication with other nodes.

Can Corda integrate with external systems and databases?
Yes, Corda provides APIs and tools to integrate with external systems and databases. It allows seamless data exchange and interoperability with existing infrastructure.

How does Corda handle tokenization of assets?
Corda supports tokenization of assets through the Corda Token SDK. It allows for the representation and transfer of digital assets on the Corda platform.

What is the role of Oracle services in Corda?
Oracle services provide external data and information to Corda smart contracts. They act as trusted sources of information for contract execution and validation.

How does Corda handle privacy in contract execution?
Corda ensures privacy in contract execution by limiting the visibility of contract terms and execution results to the involved parties. Only the required information is shared on a need-to-know basis.

Can Corda be used for private or consortium blockchains?
Yes, Corda is well-suited for private or consortium blockchains. It allows organizations to establish private networks with controlled access and permissions.

What is the role of the Corda Network Map?
The Corda Network Map provides information about participating nodes in the network. It acts as a directory and allows nodes to discover and connect with each other.

How does Corda handle the validation of transactions?
Corda uses a combination of deterministic validation and pluggable contract code to validate transactions. Contract code specifies the rules and constraints for transaction validation.

Can Corda handle complex multi-party workflows?
Yes, Corda is designed to handle complex multi-party workflows. The Corda flows framework allows developers to define and execute intricate transaction workflows involving multiple participants.

What is the significance of Corda's "Confidential Identity" feature?
Corda's Confidential Identity feature allows participants to transact on the network without exposing their actual identity. It ensures privacy and confidentiality during transactions.

How does Corda handle transaction fee management?
Corda provides flexibility in transaction fee management. Participants can define and negotiate transaction fees based on their agreement and requirements.

What is Corda's approach to handling data immutability?
Corda ensures data immutability through the use of cryptographic hashing and digital signatures. Once a transaction is added to the ledger, it cannot be altered or tampered with.

Can Corda handle large-scale deployments?
Yes, Corda is designed to handle large-scale deployments. It provides scalability and performance optimization features to accommodate a high volume of transactions.

What is the role of Corda's "time-window" feature?
The time-window feature in Corda allows participants to specify a time frame within which a transaction can be valid. It adds a temporal dimension to transaction validity.

How does Corda handle dispute resolution in transactions?
Corda provides mechanisms for dispute resolution through its smart contract functionality. Participants can define dispute resolution processes within the contract code.

What is the role of Corda's "attachment" feature?
Corda's attachment feature allows participants to attach additional data and documents to transactions. It facilitates the exchange of supporting information related to the transaction.

Can Corda support regulatory reporting and compliance?
Yes, Corda provides features to support regulatory reporting and compliance. It allows for the integration of regulatory requirements into smart contracts.

How does Corda handle network upgrades and protocol changes?
Corda handles network upgrades and protocol changes through a structured upgrade process. It ensures compatibility between different versions of the Corda network.

What is the role of Corda's "Flow Logic"?
Flow Logic in Corda represents the business logic and rules associated with a transaction. It specifies the steps and conditions for the successful execution of a transaction.

How does Corda handle secure communication between nodes?
Corda ensures secure communication between nodes through the use of secure protocols and encryption. It protects the confidentiality and integrity of data exchanged between participants.

Can Corda integrate with existing enterprise systems and APIs?
Yes, Corda provides tools and APIs for seamless integration with existing enterprise systems and APIs. It allows for the exchange of data and information between Corda and external systems.

What is the role of Corda's "state reference"?
A state reference in Corda is a pointer to a specific state on the ledger. It allows participants to refer to a particular state when executing transactions or validating contracts.

How does Corda handle transaction verification?
Corda uses deterministic verification to ensure that all participants agree on the validity of a transaction. It eliminates the need for trust in a central authority for verification.

Can Corda handle regulatory changes and compliance updates?
Yes, Corda is designed to accommodate regulatory changes and compliance updates. It provides flexibility to update smart contracts and incorporate new regulations as required.

What is the role of Corda's "Scheduled States"?
Scheduled States in Corda represent transactions that are time-sensitive and need to be executed at a specific future time. They allow for the automation of scheduled transactions.

How does Corda handle data privacy in a consortium network?
Corda ensures data privacy in a consortium network by restricting access to transaction data only to the involved parties. It maintains confidentiality and privacy between consortium members.

Can Corda handle complex financial instruments and derivatives?
Yes, Corda is capable of handling complex financial instruments and derivatives. Its flexibility and programmability allow for the representation and execution of various financial instruments.

What is the role of Corda's "flow sessions"?
Flow sessions in Corda represent the communication channels established between parties involved in a transaction. They enable secure and private communication during transaction execution.

How does Corda handle network security?
Corda incorporates various security measures to ensure network security, including cryptographic techniques, secure communication protocols, and permissioned access controls.

Can Corda handle cross-border regulatory compliance?
Yes, Corda can handle cross-border regulatory compliance. It provides mechanisms for incorporating regulatory requirements and compliance checks into smart contracts.

What is the role of Corda's "Contract Upgrades"?
Contract Upgrades in Corda allow participants to upgrade existing smart contracts while maintaining backward compatibility. It enables the seamless evolution of smart contracts over time.

How does Corda handle transaction privacy in a consortium network?
Corda ensures transaction privacy in a consortium network by employing techniques such as transaction tear-offs and sharing transaction data only with involved parties.

Can Corda support complex financial workflows involving multiple parties?
Yes, Corda is designed to support complex financial workflows involving multiple parties. Its flows framework enables the coordination and execution of intricate transaction workflows.

What is the role of Corda's "States Notary"?
The States Notary in Corda is responsible for ensuring the uniqueness and validity of states. It prevents double-spending and maintains the integrity of the ledger.

How does Corda handle data reconciliation between parties?
Corda handles data reconciliation through the use of shared ledger technology. All participants have a copy of the ledger, ensuring consistency and reconciliation of data.

Can Corda handle off-ledger data storage and integration?
Yes, Corda supports off-ledger data storage and integration. It provides APIs and mechanisms for storing and integrating data with external systems and databases.

What is the role of Corda's "Contract State"?
Contract State in Corda represents the current state of a specific agreement or contract. It holds the data associated with the agreement and provides the basis for transaction execution.

How does Corda handle transaction traceability and auditability?
Corda ensures transaction traceability and auditability through its immutable ledger. All transactions are recorded on the ledger, allowing for transparent and auditable transaction history.

Can Corda handle complex payment settlements and reconciliation?
Yes, Corda can handle complex payment settlements and reconciliation. Its smart contract functionality and flows framework allow for the execution of intricate payment processes.

What is the role of Corda's "notary clusters"?
Notary clusters in Corda provide fault tolerance and scalability in transaction notarization. They distribute the workload and ensure redundancy for high availability.

How does Corda handle the issue of double-spending?
Corda prevents double-spending through the use of notaries. Notaries validate transactions and ensure that the same state is not spent twice.

Can Corda handle multi-party consensus in transaction execution?
Yes, Corda supports multi-party consensus in transaction execution. Participants involved in a transaction must agree on the validity of the transaction before it can be finalized.

What is the significance of Corda's "Unspent Transaction Output" model?
The Unspent Transaction Output (UTXO) model in Corda ensures that transaction outputs are consumed in their entirety, avoiding the need for change outputs. It simplifies transaction handling and improves privacy.

How does Corda handle the issuance and management of digital assets?
Corda provides features and tools for the issuance and management of digital assets. It allows participants to define and represent digital assets on the Corda platform.

Can Corda handle the execution of complex business rules in smart contracts?
Yes, Corda supports the execution of complex business rules in smart contracts. Its programmable contract code allows for the implementation of intricate business logic.

What is the role of Corda's "flow checkpoints"?
Flow checkpoints in Corda allow for the resumption of interrupted flows. They ensure that flows can be paused and resumed without losing progress.

How does Corda handle the verification of transaction inputs?
Corda verifies transaction inputs through the use of cryptographic signatures. It ensures that transaction inputs are authorized by the respective owners before execution.

Can Corda handle the integration of external data sources and APIs?
Yes, Corda provides mechanisms for integrating external data sources and APIs. It allows for the inclusion of real-time and external data in smart contracts and transaction execution.

What is the role of Corda's "QueryableState" interface?
The QueryableState interface in Corda allows participants to query and retrieve specific state data from the ledger. It facilitates data retrieval and analysis within the Corda network.

How does Corda handle transaction scalability in a large network?
Corda achieves transaction scalability in a large network through its unique approach to transaction verification. Only the involved parties perform verification, reducing computational overhead.

Can Corda support the issuance and management of stablecoins?
Yes, Corda can support the issuance and management of stablecoins. Its flexible architecture allows for the representation and execution of different types of digital currencies.

What is the role of Corda's "FlowLogicRef"?
FlowLogicRef in Corda represents a reference to a specific flow logic or transaction flow. It allows for the coordination and execution of predefined flow processes.

How does Corda handle the storage and retrieval of historical transaction data?
Corda provides mechanisms for storing and retrieving historical transaction data. Participants can access and analyze past transactions for auditing and compliance purposes.

Can Corda handle the execution of complex legal contracts?
Yes, Corda is designed to handle the execution of complex legal contracts. Its smart contract functionality allows for the representation and automation of legal agreements.

What is the role of Corda's "Contract Constraints"?
Contract Constraints in Corda define the conditions and constraints that must be met for a transaction to be considered valid. They ensure that transactions adhere to specific business rules and requirements.

How does Corda handle the issuance and tracking of non-fungible tokens (NFTs)?
Corda provides features for the issuance and tracking of non-fungible tokens. It allows for the representation and transfer of unique digital assets on the Corda platform.

Can Corda handle the integration of external identity providers?
Yes, Corda supports the integration of external identity providers. It allows participants to leverage existing identity infrastructure for authentication and authorization.

What is the role of Corda's "Transaction Tear-Offs"?
Transaction Tear-Offs in Corda allow participants to share transaction data with specific parties involved in the transaction. It ensures privacy by limiting the visibility of transaction data to the necessary parties.

How does Corda handle transaction dependency resolution?
Corda handles transaction dependency resolution through the use of transaction tear-offs and transaction chains. It ensures that transactions are executed in the correct order to satisfy dependencies.

Can Corda support the implementation of multi-party escrow contracts?
Yes, Corda can support the implementation of multi-party escrow contracts. Its smart contract functionality allows for the automation and execution of complex escrow processes.

What is the role of Corda's "Contract Upgrade Policy"?
The Contract Upgrade Policy in Corda defines the rules and conditions for upgrading existing smart contracts. It ensures that contract upgrades follow predefined policies and requirements.

How does Corda handle transaction atomicity and consistency?
Corda ensures transaction atomicity and consistency through the use of transactions and the validation process. Transactions are executed as atomic units, ensuring consistency in state changes.

Can Corda handle the execution of complex supply chain workflows?
Yes, Corda is capable of handling complex supply chain workflows. Its flows framework allows for the coordination and execution of intricate supply chain processes.

What is the role of Corda's "Time Slicing" feature?
The Time Slicing feature in Corda allows participants to limit the computational resources allocated to a specific transaction. It prevents resource-intensive transactions from monopolizing network resources.

How does Corda handle the integration of external payment systems?
Corda provides tools and APIs for integrating external payment systems. It allows for seamless integration with existing payment infrastructure and systems.

Can Corda handle the issuance and management of digital identities?
Yes, Corda can support the issuance and management of digital identities. It provides mechanisms for identity verification and authentication within the Corda network.

What is the role of Corda's "Business Network"?
The Business Network in Corda represents a network of organizations and participants who transact on the Corda platform. It facilitates secure and private communication between network participants.

How does Corda handle transaction authorization and access control?
Corda implements transaction authorization and access control through the use of cryptographic signatures and permissioned access controls. It ensures that only authorized participants can execute transactions.

Can Corda support the execution of complex insurance contracts?
Yes, Corda is designed to support the execution of complex insurance contracts. Its smart contract functionality allows for the representation and automation of insurance agreements.

What is the role of Corda's "Vault"?
The Vault in Corda is a storage facility for states and transactions. It allows participants to query and retrieve specific states and transaction data from the ledger.

How does Corda handle the integration of external pricing and market data sources?
Corda provides tools and APIs for integrating external pricing and market data sources. It allows for real-time data integration within smart contracts and transaction execution.

Can Corda handle the execution of complex healthcare workflows?
Yes, Corda can handle complex healthcare workflows. Its flows framework and privacy features enable secure and efficient coordination of healthcare-related transactions.

What is the role of Corda's "Transaction Tear-Up" feature?
The Transaction Tear-Up feature in Corda allows participants to discard a transaction if it no longer meets the required conditions. It ensures the integrity and validity of transactions.

How does Corda handle the integration of external compliance systems?
Corda provides mechanisms for integrating external compliance systems. It allows for the incorporation of compliance checks and regulations within smart contracts and transaction execution.

Can Corda handle the issuance and management of asset-backed tokens?
Yes, Corda supports the issuance and management of asset-backed tokens. It allows for the representation and transfer of tokens backed by real-world assets on the Corda platform.

What is the role of Corda's "Vault Query"?
Vault Query in Corda allows participants to perform complex queries on the vault, retrieving specific states and transaction data based on defined criteria. It facilitates advanced data analysis and reporting.

How does Corda handle transaction finality and settlement?
Corda achieves transaction finality and settlement through the consensus process and notarization. Once a transaction is notarized and consensus is reached, it is considered final and settled.

Can Corda support the execution of complex trade finance workflows?
Yes, Corda is designed to support complex trade finance workflows. Its smart contract functionality and flows framework allow for the coordination and execution of intricate trade finance processes.

What is the role of Corda's "Identity Service"?
The Identity Service in Corda provides identity verification and authentication services for participants. It ensures that participants' identities are securely managed within the Corda network.

Saturday, July 1, 2023

Flutter Questions and Answers

 

Note

 These questions and answers are collected from different resources on the internet like stackoverflow, medium and other github repositories

 

1.What is the difference between a StatelessWidget and a StatefulWidget in Flutter?

Stateless Widget A stateless widget can not change their state during the runtime of an app which means it can not redraw its self while the app is running. Stateless widgets are immutable.

Stateful Widget A stateful widget can redraw itself multiple times, while the app is running which means its state is mutable. For example, when a button is pressed, the state of the widget is changed


2.Explain the Stateful Widget Lifecycle?

The lifecycle has the following simplified steps: createState() mounted == true initState() didChangeDependencies() build() didUpdateWidget() setState() deactivate() dispose() mounted == false

life cycle


3.What is Flutter tree shaking (flutter web)?

When compiling a Flutter web application, the JavaScript bundle is generated by the dart2js compiler. A release build has the highest level of optimization, which includes tree shaking your code. Tree shaking is the process of eliminating dead code, by only including code that is guaranteed to be executed. This means that you do not need to worry about the size of your app’s included libraries because unused classes or functions are excluded from the compiled JavaScript bundle


4.What is a Spacer widget?

Spacer manages the empty space between the widgets with flex container. Evenly with the Row and Column MainAxis alignment we can manage the space as well


5.What is the difference between hot restart and hot reload?

What is Hot Reload in Flutter:

Flutter hot reload features works with combination of Small r key on command prompt or Terminal. 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 then Hot restart. There is also a draw back 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

What is Hot Restart in Flutter:

Hot restart is much different than hot reload. In Hot restart it destroys the preserves State value and set them to their default. So if you are using States value in your application then After every hot restart the developer gets fully compiled application and all the states will set to their defaults. The app widget tree is completely rebuilt with new typed code. Hot Restart takes much higher time than Hot reload


6.What is an InheritedWidget?

https://www.youtube.com/watch?v=Zbm3hjPjQMk


7.Why is the build() method on State and not StatefulWidget?

stateful_build


8.What is a pubspec file in Dart?

The pubspec file manages the assets and dependencies for a Flutter app.


9.How is Flutter native?

Flutter uses only the canvas of the native platform and draws the UI and all the components from scratch. All the UI elements look the same as native ones. This mainly reduces the burden of time for converting through some language to the native one and speeds up the UI rendering time. As a result, the UI performance is remarkably high


10.What is a Navigator and what are Routes in Flutter?

Navigation and routing are some of the core concepts of all mobile application, which allows the user to move between different pages. We know that every mobile application contains several screens for displaying different types of information. For example, an app can have a screen that contains various products. When the user taps on that product, immediately it will display detailed information about that product


11.What is a PageRoute?

Allow us to add animation transaction to the route https://github.com/divyanshub024/Flutter-route-transition


12.Explain async, await and Future?

Async means that this function is asynchronous and you might need to wait a bit to get its result. Await literally means - wait here until this function is finished and you will get its return value. Future is a type that ‘comes from the future’ and returns value from your asynchronous function. It can complete with success(.then) or with an error(.catchError)

https://www.youtube.com/watch?v=SmTCmDMi4BY


13.how can you update a listview dynamically?

By using setState to update the listview item source and rebuild the UI


14.What is a Stream?

A stream is like a pipe, you put a value on the one end and if there’s a listener on the other end that listener will receive that value. A Stream can have multiple listeners and all of those listeners will receive the same value when it’s put in the pipeline. The way you put values on a stream is by using a StreamController


15.What are keys in Flutter and when should you use it?

You don't need to use Keys most of the time, the framework handles it for you and uses them internally to differentiate between widgets. There are a few cases where you may need to use them though.

A common case is if you need to differentiate between widgets by their keys, ObjectKey and ValueKey can be useful for defining how the widgets are differentiated

Another example is that if you have a child you want to access from a parent, you can make a GlobalKey in the parent and pass it to the child's constructor. Then you can do globalKey.state to get the child's state (say for example in a button press callback). Note that this shouldn't be used excessively as there are often better ways to get around it

https://www.youtube.com/watch?v=kn0EOS-ZiIc&feature=emb_title


16.What are GlobalKeys?

GlobalKeys have two uses: they allow widgets to change parents anywhere in your app without losing state, or they can be used to access information about another widget in a completely different part of the widget tree. An example of the first scenario might if you wanted to show the same widget on two different screens, but holding all the same state, you’d want to use a GlobalKey


17.When should you use mainAxisAlignment and crossAxisAlignment?

mainAxisAlignment


18.When can you use double.INFINITY?

When you want the widget to be big as the parent widget allow


19.What is Ticker, Tween and AnimationController?

ticker

Animation Sequences To achieve sequence animation we’ll introduce a new Widget that also helps with reducing animation code called AnimatedBuilder which allows you to rebuild your widget through a builder function every time a new animation value is calculated


20.What is ephemeral state?

ephemeral


21.What is an AspectRatio widget used for?

AspectRatio Widget tries to find the best size to maintain aspect ration while respecting it’s layout constraints. The AspectRatio Widget can be used to adjust the aspect ratio of widgets in your app


22.How would you access StatefulWidget properties from its State?

Using the widget property


23.Mention two or more operations that would require you to use or turn a Future

1. Calling api using http
2. Getting result from geolocator package 
3. With FutureBuilder widget 

24.What is the purpose of a SafeArea?

SafeArea is basically a glorified Padding widget. If you wrap another widget with SafeArea, it adds any necessary padding needed to keep your widget from being blocked by the system status bar, notches, holes, rounded corners and other "creative" features by manufactures


25.When to use a mainAxisSize?

When you use MainAxisSize on your Column or Row, they will determine the size of the Column or Row along the main axis, i.e, height for Column and width for Row

https://itnext.io/flutter-mainaxissize-max-vs-min-d9095d8f7914


26.SizedBox VS Container?

sized

sized2


27.List the Visibility widgets in flutter and the differences?

1. Visibility
2. Opacity
3. Offstage

https://medium.com/@danle.sdev/widget-hide-and-seek-a-guide-to-managing-flutter-widgets-visibility-d7977cbaf444


28.Can we use Color and Decoration property simultaneously in the Container?

No

The color property is a shorthand for creating a BoxDecoration with a color field. If you are adding a box decoration, simply place the color on the BoxDecoration.


29.Inorder for the CrossAxisAlignment.baseline to work what is another property that we need to set?

crossAxisAlignment: CrossAxisAlignment.baseline textBaseline: TextBaseline.ideographic,


30.when should we use a resizeToAvoidBottomInset?

If true the body and the scaffold's floating widgets should size themselves to avoid the onscreen keyboard whose height is defined by the ambient MediaQuery's MediaQueryData.viewInsets bottom property.

For example, if there is an onscreen keyboard displayed above the scaffold, the body can be resized to avoid overlapping the keyboard, which prevents widgets inside the body from being obscured by the keyboard

With resizeToAvoidBottomInset https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/316760/7da984e6-ec32-7989-174c-0e104e4c5557.gif

without resizeToAvoidBottomInset https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/316760/0c933d45-82a2-4401-836c-d1c6f5abc2db.gif


31.What is the difference between as,show and hide in an import statement?

as


32.What is the importance of a TextEditingController?

Whenever the user modifies a text field with an associated TextEditingController, the text field updates value and the controller notifies its listeners. Listeners can then read the text and selection properties to learn what the user has typed or how the selection has been updated


33.Why do we use a Reverse property in a Listview?

List animals = ['cat', 'dog', 'duck']; List reversedAnimals = animals.reversed.toList();


34.Difference between a Modal and Persistent BottomSheet with an example?


35.How is an Inherited Widget different from a Provider?

Provider basically takes the logic of InheritedWidgets, but reduce the boilerplate to the strict minimum


36.What is an UnmodifiableListView?

Cannot change the list items by adding or removing

filiph/state_experiments#5


37.Difference between these operators ?? and ?.

?? expr1 ?? expr2 If expr1 is non-null, returns its value; otherwise, evaluates and returns the value of expr2.

?. Like . but the leftmost operand can be null; example: foo?.bar selects property bar from expression foo unless foo is null (in which case the value of foo?.bar is null)

https://dart.dev/guides/language/language-tour


38.What is the purpose of ModalRoute.of()?

ModalRoute.of() method. This method returns the current route with the arguments

final args = ModalRoute.of(context).settings.arguments;


39.Difference between a Navigator.pushNamed and Navigator.pushReplacementNamed?

pushNamed


40.Difference between a Single Instance and Scoped Instance ?

https://codewithandrea.com/articles/2019-06-10-global-access-vs-scoped-access/


41.Difference between getDocuments() vs snapshots()?

getDocuments


42.What is a vsync?

Vsync basically keeps the track of screen, so that Flutter does not renders the animation when the screen is not being displayed


43.When does the animation reach completed or dismissed status?

animations that progress from 0.0 to 1.0 will be dismissed when their value is 0.0. An animation might then run forward (from 0.0 to 1.0) or perhaps in reverse (from 1.0 to 0.0). Eventually, if the animation reaches the end of its range (1.0), the animation reaches the completed status.


44.Difference between AnimationController and Animation?

AnimationController is for how long the animation would be and how to control from time, upper and lower boundary, how to control data with time, length, sequence, etc. while AnimationTween is for the range of animation with time, colour, range, sequence, etc as long the animation would be while


45.When to use a SingleTickerProviderStateMixin and TickerProviderStateMixin?


46.Define a TweenAnimation ?

Short for in-betweening. In a tween animation, the beginning and ending points are defined, as well as a timeline, and a curve that defines the timing and speed of the transition. The framework calculates how to transition from the beginning point to the end point


47.State the importance of a Ticker ?

Ticker is the refresh rate of our animations. This is what we want to pause when our clock is hidden.

A bonus for using Ticker is that this allows the dev-tool to “slow” our animation. If we use “Slow animations”, then our clock is slowed by 50%. This is a good sign, as it means it will be a lot easier to test our clock!


48.Why do we need a mixins ?

Mixins are very helpful when we want to share a behavior across multiple classes that don’t share the same class hierarchy, or when it doesn’t make sense to implement such a behavior in a superclass


49.When do you use the WidgetsBindingObserver?

To check when the system puts the app in the background or returns the app to the foreground


50.Why does the first flutter app take a very long developing time?

When you are going to build the Flutter app for the first time, it takes a very long time than usual because Flutter builds a device-specific IPA or APK file. In this process, the Xcode and Gradle are used to build a file, which usually takes a long time


51.Define what is an App State?

The App State is also called an application state or shared state. The app state can be distributed across multiple areas of your app and the same is maintained with user sessions.

Following are the examples of App State:

Login info User preferences The shopping cart of an e-commerce application


52.What are the two types of Streams available in Flutter?

Single subscription streams:

It is a popular and common type of stream. It consists of a series of events that are parts of a large whole. Here all events have to be delivered in a defined order without even missing a single event. It is a type of stream that you get when you get a web request or receive a file. This stream can only be listed once. Listing it, again and again, means missing initial values and overall stream makes no sense at all. When the listing starts in this stream the data gets fetched and provided in chunks.

Broadcast streams:

This stream is meant for the individual messages that can be handled one at a time. These types of streams are commonly used for mouse events in a browser. You can list this type of stream at any time. Multiple listeners can listen at a time and also you have a chance to listen after the cancellation of the previous subscription


53.What do you know about Dart Isolates?

To gain concurrency Dart makes use of the Isolates method which works on its own without sharing memory but uses passing or message communication.


54.What is a Flutter inspector?

Flutter inspector is a tool that helps in visualizing and exploring the widget trees. It helps in understanding the present layout and diagnoses various layout issues


55.Stream vs Future?

The difference is that Futures are about one-shot request/response (I ask, there is a delay, I get a notification that my Future is ready to collect, and I'm done!) whereas Streams are a continuous series of responses to a single request (I ask, there is a delay, then I keep getting responses until the stream dries up or I decide to close it and walk away)


56.How to compare two dates that are constructed differently in Dart?

date


57.What's the difference between async and async* in Dart?

async


58.Debug vs Profile mode?

In debug mode, the app is set up for debugging on the physical device, emulator, or simulator.

Debug

Assertions are enabled. Service extensions are enabled. Compilation is optimized for fast development and run cycles (but not for execution speed, binary size, or deployment). Debugging is enabled, and tools supporting source level debugging (such as DevTools) can connect to the process.

Profile In profile mode, some debugging ability is maintained—enough to profile your app’s performance. Profile mode is disabled on the emulator and simulator, because their behavior is not representative of real performance. On mobile, profile mode is similar to release mode, with the following differences:

Some service extensions, such as the one that enables the performance overlay, are enabled. Tracing is enabled, and tools supporting source-level debugging (such as DevTools) can connect to the process.


59.How to convert a List into a Map in Dart?

list


60.What does non-nullable by default mean?

no_null


61.Expanded vs Flexible?

flex1

flex2


62.Why is exit(0) not preferred for closing an app?

exit0


63.What is the difference between main function and the runApp() function in Flutter?

In Dart, main() acts as the entry point for the program whereas runApp() attaches the given widget to the screen.


64.What is Dart and why does Flutter use it?

Dart is AOT (Ahead Of Time) compiled to fast, predictable, native code, which allows almost all of Flutter to be written in Dart. This not only makes Flutter fast, virtually everything (including all the widgets) can be customized.

Dart can also be JIT (Just In Time) compiled for exceptionally fast development cycles and game-changing workflow (including Flutter’s popular sub-second stateful hot reload).

Dart makes it easier to create smooth animations and transitions that run at 60fps. Dart can do object allocation and garbage collection without locks. And like JavaScript, Dart avoids preemptive scheduling and shared memory (and thus locks). Because Flutter apps are compiled to native code, they do not require a slow bridge between realms (e.g., JavaScript to native). They also start up much faster.

Dart allows Flutter to avoid the need for a separate declarative layout language like JSX or XML, or separate visual interface builders, because Dart’s declarative, programmatic layout is easy to read and visualize. And with all the layout in one language and in one place, it is easy for Flutter to provide advanced tooling that makes layout a snap.

Developers have found that Dart is particularly easy to learn because it has features that are familiar to users of both static and dynamic languages


65.Where are the layout files? Why doesn’t Flutter have layout files?

In the Android framework, we separate an activity into layout and code. Because of this, we need to get references to views to work on them in Java. (Of course Kotlin lets you avoid that.) The layout file itself would be written in XML and consist of Views and ViewGroups.

Flutter uses a completely new approach where instead of Views, you use widgets. A View in Android was mostly an element of the layout, but in Flutter, a Widget is pretty much everything. Everything from a button to a layout structure is a widget. The advantage here is in customisability. Imagine a button in Android. It has attributes like text which lets you add text to the button. But a button in Flutter does not take a title as a string, but another widget. Meaning inside a button you can have text, an image, an icon and pretty much anything you can imagine without breaking layout constraints. This also lets you make customised widgets pretty easily whereas in Android making customised views is a rather difficult thing to do


66.What is the difference between final and const in Flutter?

final means single-assignment: A final variable or field must have an initializer. Once assigned a value, a final variable's value cannot be changed. final modifies variables.

const has a meaning that's a bit more complex and subtle in Dart. const modifies values. You can use it when creating collections, like const [1, 2, 3], and when constructing objects (instead of new) like const Point(2, 3). Here, const means that the object's entire deep state can be determined entirely at compile time and that the object will be frozen and completely immutable.

Const objects have a couple of interesting properties and restrictions:

They must be created from data that can be calculated at compile time. A const object does not have access to anything you would need to calculate at runtime. 1 + 2 is a valid const expression, but new DateTime.now() is not.

They are deeply, transitively immutable. If you have a final field containing a collection, that collection can still be mutable. If you have a const collection, everything in it must also be const, recursively.

They are canonicalized. This is sort of like string interning: for any given const value, a single const object will be created and re-used no matter how many times the const expression(s) are evaluated.

https://news.dartlang.org/2012/06/const-static-final-oh-my.html


Android 13 Features

Personalization: Android 13 introduces a new design language called Material You, which allows you to customize the look and f...