key property

A String that differentiates a component from its siblings.

When setting key you can use any Object, its toString() method will be called when applying the value.

Keys are necessary when children are dynamic, such as those passed in as a List, but are generally not required when using variadic children.

For more info, see:

Implementation

@override
String? get key => props['key'] as String?;
  1. @override
void key=(Object? value)

ignore: prefer_null_aware_operators

Implementation

@override
set key(Object? value) =>
    props['key'] = value == null ? null : value.toString();