Flutter commonly uses keys when it needs to uniquely identify specific widgets within a collection . Using keys also helps Flutter preserve the state of StatefulWidget s while they’re being replaced with other widgets or just moved in the widget tree.