Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed dawood committed Apr 18, 2022
1 parent 6794bf9 commit 73a5e56
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/ready_image/example/.flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_ios","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.8/","dependencies":[]},{"name":"sqflite","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.2+1/","dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.12/","dependencies":[]},{"name":"sqflite","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.2+1/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.5/","dependencies":[]},{"name":"sqflite","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.2+1/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-04-18 01:33:47.171319","version":"2.10.4"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider_ios","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_ios-2.0.8/","dependencies":[]},{"name":"sqflite","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.2+1/","dependencies":[]}],"android":[{"name":"path_provider_android","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.12/","dependencies":[]},{"name":"sqflite","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.2+1/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.5/","dependencies":[]},{"name":"sqflite","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.2+1/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.1.5/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/dawood/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.5/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_android","path_provider_ios","path_provider_linux","path_provider_macos","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_ios","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-04-18 02:08:43.094092","version":"2.10.4"}
2 changes: 1 addition & 1 deletion packages/ready_image/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.8"
version: "0.0.9"
rxdart:
dependency: transitive
description:
Expand Down
22 changes: 21 additions & 1 deletion packages/ready_image/lib/ready_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,31 @@ class ReadyImage extends StatelessWidget {
decoration: decoration,
foregroundDecoration: foreground,
padding: p.innerPadding,
child: child,
child: ClipPath(
clipBehavior: Clip.antiAlias,
clipper: _DecorationClipper(decoration, Directionality.of(context)),
child: child,
),
);
}
}

class _DecorationClipper extends CustomClipper<Path> {
final Decoration decoration;
final TextDirection textDirection;
_DecorationClipper(this.decoration, this.textDirection);

@override
Path getClip(Size size) {
return decoration.getClipPath(
Rect.fromLTWH(0, 0, size.width, size.height), textDirection);
}

@override
bool shouldReclip(covariant _DecorationClipper oldClipper) =>
decoration != oldClipper.decoration;
}

/// instead of using the normal hero you can use this as it will animate its properties
class HeroReadyImage extends StatelessWidget {
final String tag;
Expand Down
2 changes: 1 addition & 1 deletion packages/ready_image/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ready_image
description: Simple and customizable image which is wrapper for cached network image ad part of ready packages
version: 0.0.8
version: 0.0.9
homepage: https://github.com/mo-ah-dawood/ready

environment:
Expand Down

0 comments on commit 73a5e56

Please sign in to comment.