Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class _MyHomePageState extends State<MyHomePage> {
child: Crop(
controller: controller,
child: Image.asset('images/sample.jpg'),
borderWidth: 5,
borderColor: Colors.red,
),
),
Row(
Expand Down
6 changes: 5 additions & 1 deletion lib/src/ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class Crop extends StatefulWidget {
final Color backgroundColor;
final Color dimColor;
final EdgeInsetsGeometry padding;
final Color borderColor;
final double borderWidth;
final CropController controller;
Crop({
Key key,
Expand All @@ -18,6 +20,8 @@ class Crop extends StatefulWidget {
this.padding: const EdgeInsets.all(8),
this.dimColor: const Color.fromRGBO(0, 0, 0, 0.8),
this.backgroundColor: Colors.black,
this.borderColor: Colors.white,
this.borderWidth: 2
}) : super(key: key);
@override
State<StatefulWidget> createState() {
Expand Down Expand Up @@ -208,7 +212,7 @@ class _CropState extends State<Crop> with TickerProviderStateMixin {
size: size,
child: Container(
decoration: BoxDecoration(
border: Border.all(color: Colors.white, width: 2),
border: Border.all(color: widget.borderColor, width: widget.borderWidth),
),
),
),
Expand Down