Skip to content

Commit

Permalink
fix: typo (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
chooyan-eng authored Dec 11, 2024
1 parent 766cc61 commit 557a0a4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018 Volodymyr Lykhonis
Copyright 2021 Tsuyoshi Chujo

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ A flutter plugin that provides `Crop` widget for cropping images.

# Philosophy

crop_your_image provides _flexible_ and _custamizable_ `Crop` widget that can be placed at anywhere in your well designed apps.
crop_your_image provides _flexible_ and _customizable_ `Crop` widget that can be placed at anywhere in your well designed apps.

As `Crop` is a simple widget displaying minimum cropping UI, `Crop` can be placed anywhere such as, for example, occupying entire screen, at top half of the screen, or even on dialogs or bottomsheets. It's totally up to you!
As `Crop` is a simple widget displaying minimum cropping UI, `Crop` can be placed anywhere such as, for example, occupying entire screen, at top half of the screen, or even on dialogs or bottom sheets. It's totally up to you!

Users' cropping operation is also customizable. By default, images are fixed on the screen and users can move crop rect to decide where to crop. Once configured _interactive_ mode, images can be zoomed/panned, and crop rect can be configured as fixed.

Expand Down Expand Up @@ -214,7 +214,7 @@ by passing the arguments below.
|-|-|-|
|formatDetector|ImageFormat Function(Uint8List)?|Function to detect the format of original image. By detecting the format before `imageParser` parses the original image from `Uint8List` to `ImageDetail`, `imageParser` will sufficiently parse the binary, which means the initializing operation speeds up. `defaultFormatDetector` is used by default|
|imageParser|ImageDetail<T> Function(Uint8List, {ImageFormat})?|Function for parsing original image from `Uint8List` to `ImageDetail`, which preserve `height`, `width` and parsed `image` with generic type `<T>`. `image` is passed to `imageCropper` with `Rect` to be cropped. `defaultImageParser` is used by default|
|imageCropper|ImageCropper<T>?|By implementing `ImageCropeper<T>` and passing its instance to this argument, you can exchange cropping logic. `defaultImageCropper` is used by default|
|imageCropper|ImageCropper<T>?|By implementing `ImageCropper<T>` and passing its instance to this argument, you can exchange cropping logic. `defaultImageCropper` is used by default|

# Gallery App

Expand Down
23 changes: 12 additions & 11 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _CropSampleState extends State<CropSample> {
_cropController.image = _imageDataList[_currentImage];
}

var _isSumbnail = false;
var _isThumbnail = false;
var _isCropping = false;
var _isCircleUi = false;
Uint8List? _croppedData;
Expand Down Expand Up @@ -103,13 +103,13 @@ class _CropSampleState extends State<CropSample> {
padding: const EdgeInsets.all(16),
child: Row(
children: [
_buildSumbnail(_imageDataList[0]),
_buildThumbnail(_imageDataList[0]),
const SizedBox(width: 16),
_buildSumbnail(_imageDataList[1]),
_buildThumbnail(_imageDataList[1]),
const SizedBox(width: 16),
_buildSumbnail(_imageDataList[2]),
_buildThumbnail(_imageDataList[2]),
const SizedBox(width: 16),
_buildSumbnail(_imageDataList[3]),
_buildThumbnail(_imageDataList[3]),
],
),
),
Expand Down Expand Up @@ -157,7 +157,7 @@ class _CropSampleState extends State<CropSample> {
}[status] ??
'';
}),
maskColor: _isSumbnail ? Colors.white : null,
maskColor: _isThumbnail ? Colors.white : null,
cornerDotBuilder: (size, edgeAlignment) =>
const SizedBox.shrink(),
interactive: true,
Expand Down Expand Up @@ -207,11 +207,12 @@ class _CropSampleState extends State<CropSample> {
right: 16,
bottom: 16,
child: GestureDetector(
onTapDown: (_) => setState(() => _isSumbnail = true),
onTapUp: (_) => setState(() => _isSumbnail = false),
onTapDown: (_) => setState(() => _isThumbnail = true),
onTapUp: (_) => setState(() => _isThumbnail = false),
child: CircleAvatar(
backgroundColor:
_isSumbnail ? Colors.blue.shade50 : Colors.blue,
backgroundColor: _isThumbnail
? Colors.blue.shade50
: Colors.blue,
child: Center(
child: Icon(Icons.crop_free_rounded),
),
Expand Down Expand Up @@ -338,7 +339,7 @@ class _CropSampleState extends State<CropSample> {
);
}

Expanded _buildSumbnail(Uint8List data) {
Expanded _buildThumbnail(Uint8List data) {
final index = _imageDataList.indexOf(data);
return Expanded(
child: InkWell(
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widget/dot_control.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:crop_your_image/src/widget/constants.dart';
import 'package:flutter/material.dart';

/// Defalt dot widget placed on corners to control cropping area.
/// This Widget automaticall fits the appropriate size.
/// Default dot widget placed on corners to control cropping area.
/// This Widget automatically fits the appropriate size.
class DotControl extends StatelessWidget {
const DotControl({
Key? key,
Expand Down

0 comments on commit 557a0a4

Please sign in to comment.