Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having issues cropping a widget with out an image #91

Open
frankjoshua opened this issue Jul 15, 2024 · 0 comments
Open

Having issues cropping a widget with out an image #91

frankjoshua opened this issue Jul 15, 2024 · 0 comments

Comments

@frankjoshua
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant