QuillSharedExtensionsConfigurations.get constructor

QuillSharedExtensionsConfigurations.get({
  1. required BuildContext context,
})

Get the instance from the widget tree in QuillSharedConfigurations if it doesn't exists, we will create new one with default options

Implementation

factory QuillSharedExtensionsConfigurations.get({
  required BuildContext context,
}) {
  final value = context.quillSharedConfigurations?.extraConfigurations[key];
  if (value != null) {
    if (value is! QuillSharedExtensionsConfigurations) {
      throw ArgumentError(
        'The value of key `$key` should be of type '
        '$key',
      );
    }
    return value;
  }
  return const QuillSharedExtensionsConfigurations();
}