cropFallback function

  1. @deprecated
Future<PFile?> cropFallback(
  1. BuildContext context,
  2. PFile source
)

Implementation

@deprecated
Future<PFile?> cropFallback(BuildContext context, PFile source) async {
  try {
    final totalSize = MediaQuery.of(context).size;
    var bytes = source.bytes ?? await source.awaitData;
    // ignore: missing_required_param
    return await Modals.open<PFile>(
      context,
      expand: true,
      height: totalSize.height - 100,
      width: totalSize.width - 100,
      constraints: BoxConstraints(
        maxHeight: totalSize.height - 100,
        maxWidth: totalSize.width - 100,
      ),
      builder: (context) {
        return ExtendedImage.memory(
          bytes,
        );
      },
    );
  } catch (e, stack) {
    _log.severe("Error $e", e, stack);
    rethrow;
  }
}