What are the keys used in the Flutter framework?

keys are very less used in the flutter framework , it works when the widget moves around in the widget tree. According to the documentation A Key is an identifier for Widgets, Elements and SemanticsNodes. A key that uses a value of a particular type to identify itself.

There are 4 types of keys that exist in Flutter

  1. Value Key
  2. Object Key
  3. Unique Key
  4. GlobalKeys


It is a regular key that uses simple Integer and string value.


If you want to show more complex data rather than string or integer then you can use the Object key.

Unique key:-

This will provide your widget unique key every time. never put this key in the build method.


The global key is used for maintaining state across the app because these are global variables

Further Reading:



Leave a Comment