add method

  1. @override
String add(
  1. StateXController? con
)
inherited

Collect a 'StateXController' Returns the StateXController's unique identifier.

Implementation

@override
String add(StateXController? con) {
  String id;
  if (con == null) {
    id = '';
  } else {
    id = con.identifier;
    if (!containsId(id)) {
      _mapControllerById[id] = con;
      // Will need to retrieve controller by type at times.
      _mapControllerTypes[id] = con.runtimeType;

      /// This connects the StateXController to this State object!
      con._pushStateToSetter(this);
    }
  }
  return id;
}