Skip to content

Having issues cropping a widget with out an image #91

Description

@frankjoshua

All I get is a blank screen. Here is a minimal example.

`
import 'package:crop/crop.dart';
import 'package:flutter/material.dart';

class CropView extends StatelessWidget {

final controller = CropController(aspectRatio: 1 / 1);

@OverRide
Widget build(BuildContext context) {
return Crop(
controller: controller,
child: Container(width: double.infinity, height: double.infinity, color: Colors.purple,),
);
}
}
`

If instead of a container I use an image then it works fine but I need to crop widgets. That's why I chose this library.

======== Exception caught by rendering library =====================================================
I/flutter (27268): The following assertion was thrown while executing callbacks for
The following assertion was thrown during paint():
RenderBox was not laid out: RenderRepaintBoundary#a514d NEEDS-PAINT
'package:flutter/src/rendering/box.dart':
Failed assertion: line 2165 pos 12: 'hasSize'

The relevant error-causing widget was:
I/flutter (27268): FrameTiming:
CropRenderObjectWidget CropRenderObjectWidget:file:///home/josh/.pub-cache/hosted/pub.dev/crop-0.5.5/lib/src/crop.dart:346:7
When the exception was thrown, this was the stack:
#2 RenderBox.size (package:flutter/src/rendering/box.dart:2165:12)
#3 RenderBox.paintBounds (package:flutter/src/rendering/box.dart:2903:41)
I/flutter (27268): 'package:flutter/src/widgets/binding.dart': Failed assertion:
#4 PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:165:56)
#5 PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:109:5)
#6 PaintingContext._compositeChild (package:flutter/src/rendering/object.dart:261:7)
#7 PaintingContext.paintChild (package:flutter/src/rendering/object.dart:242:7)
#8 RenderCrop.paint (package:crop/src/crop_render.dart:87:15)
#9 RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:3239:7)
#10 PaintingContext.paintChild (package:flutter/src/rendering/object.dart:250:13)
#11 RenderBoxContainerDefaultsMixin.defaultPaint (package:flutter/src/rendering/box.dart:3158:15)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions