ComponentView constructor

ComponentView({
  1. Key? key,
  2. required _MPComponentFactory componentFactory,
  3. Map? data,
  4. Map? parentData,
  5. Widget? child,
  6. bool? noLayout,
})

Implementation

ComponentView({
  Key? key,
  required this.componentFactory,
  this.data,
  this.parentData,
  this.child,
  this.noLayout,
})  : dataHashCode = (() {
        if (data?['hashCode'] is int) {
          return data!['hashCode'];
        } else {
          return null;
        }
      })(),
      adjustOffset = (() {
        if (parentData != null && parentData['adjustOffset'] is Offset) {
          return parentData['adjustOffset'] as Offset;
        }
      })(),
      super(
        key: key ?? Key('mp_${data?['hashCode'] ?? Random().nextDouble()}'),
      );