Skip to content

Commit

Permalink
Added boxFit property, improved border stroke and fixed extra padding…
Browse files Browse the repository at this point in the history
… issue.
  • Loading branch information
ch-muhammad-adil committed Sep 3, 2021
1 parent ea4a694 commit fc296b8
Show file tree
Hide file tree
Showing 14 changed files with 320 additions and 657 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -10,3 +10,4 @@ ios/Flutter/Generated.xcconfig
ios/Runner/GeneratedPluginRegistrant.*
/.fvm
/android
.idea/workspace.xml
408 changes: 225 additions & 183 deletions .idea/libraries/Dart_Packages.xml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions .idea/libraries/Flutter_Plugins.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

425 changes: 13 additions & 412 deletions .idea/workspace.xml

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
## [2.0.2] - 03 September 2021
Added boxFit property, improved border stroke and fixed extra padding issue.

## [2.0.1-nullsafety] - 17 March 2021
Upgraded to null safety (Flutter 2.0)

Expand Down
12 changes: 1 addition & 11 deletions README.md
Expand Up @@ -4,17 +4,6 @@ CircularProfileAvatar is a Flutter package which allows developers to implement

![](screenshots/Screenshot.png)

# Installation
Add this to your package's pubspec.yaml file:

dependencies:
circular_profile_avatar: ^1.0.8

and run

flutter packages get

# Usage

Expand All @@ -32,6 +21,7 @@ and run
elevation: 5.0, // sets elevation (shadow of the profile picture), default value is 0.0
foregroundColor: Colors.brown.withOpacity(0.5), //sets foreground colour, it works if showInitialTextAbovePicture = true , default Colors.transparent
cacheImage: true, // allow widget to cache image against provided url
imageFit = BoxFit.cover,
onTap: () {
print('adil');
}, // sets on tap
Expand Down
3 changes: 3 additions & 0 deletions circular_profile_avatar.iml
Expand Up @@ -232,6 +232,9 @@
<excludeFolder url="file://$MODULE_DIR$/example/ios/Flutter/flutter_assets/packages" />
<excludeFolder url="file://$MODULE_DIR$/example_app/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/example_app/.pub" />
<excludeFolder url="file://$MODULE_DIR$/.fvm/flutter_sdk/dev/benchmarks/multiple_flutters/module/.pub" />
<excludeFolder url="file://$MODULE_DIR$/.fvm/flutter_sdk/dev/benchmarks/multiple_flutters/module/build" />
<excludeFolder url="file://$MODULE_DIR$/.fvm/flutter_sdk/dev/benchmarks/multiple_flutters/module/.dart_tool" />
</content>
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
1 change: 1 addition & 0 deletions example/.flutter-plugins-dependencies
@@ -0,0 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"path_provider","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]},{"name":"sqflite","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+3/","dependencies":[]}],"android":[{"name":"path_provider","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]},{"name":"sqflite","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+3/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","dependencies":[]},{"name":"sqflite","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/sqflite-2.0.0+3/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/adil/fvm/1.22.6/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.0/","dependencies":[]}],"web":[]},"dependencyGraph":[{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2021-09-03 20:25:23.044779","version":"2.2.3"}
18 changes: 18 additions & 0 deletions example/ios/Flutter/Flutter.podspec
@@ -0,0 +1,18 @@
#
# NOTE: This podspec is NOT to be published. It is only used as a local source!
# This is a generated file; do not edit or check into version control.
#

Pod::Spec.new do |s|
s.name = 'Flutter'
s.version = '1.0.0'
s.summary = 'High-performance, high-fidelity mobile apps.'
s.homepage = 'https://flutter.io'
s.license = { :type => 'MIT' }
s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
# Framework linking is handled by Flutter tooling, not CocoaPods.
# Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
s.vendored_frameworks = 'path/to/nothing'
end
15 changes: 15 additions & 0 deletions example/ios/Flutter/flutter_export_environment.sh
@@ -0,0 +1,15 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/adil/fvm/versions/stable"
export "FLUTTER_APPLICATION_PATH=/Users/adil/Development/Mob/cross-platform/my_flutter_packages/circular_profile_avatar/example"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=/Users/adil/Development/Mob/cross-platform/my_flutter_packages/circular_profile_avatar/example/lib/main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=Zmx1dHRlci5pbnNwZWN0b3Iuc3RydWN0dXJlZEVycm9ycz10cnVl,RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ=="
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=/Users/adil/Development/Mob/cross-platform/my_flutter_packages/circular_profile_avatar/example/.dart_tool/package_config.json"
14 changes: 7 additions & 7 deletions lib/circular_profile_avatar.dart
Expand Up @@ -88,8 +88,7 @@ class CircularProfileAvatar extends StatefulWidget {
final Widget? child;

/// How to inscribe the image into the space allocated during layout.
/// Set the BoxFit value as you want.
/// Set the [BoxFit] value as you want.
final BoxFit imageFit;

@override
Expand All @@ -111,10 +110,11 @@ class _CircularProfileAvatarState extends State<CircularProfileAvatar> {
child: Container(
height: widget.radius * 2,
width: widget.radius * 2,
padding: EdgeInsets.all(widget.borderWidth),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(widget.radius),
color: widget.borderColor),
borderRadius: BorderRadius.circular(widget.radius),
border: Border.all(
width: widget.borderWidth, color: widget.borderColor),
),
child: Center(
child: Container(
decoration: BoxDecoration(
Expand Down Expand Up @@ -153,8 +153,8 @@ class _CircularProfileAvatarState extends State<CircularProfileAvatar> {
return ClipRRect(
borderRadius: BorderRadius.circular(widget.radius),
child: Container(
height: widget.radius * 2 - widget.borderWidth,
width: widget.radius * 2 - widget.borderWidth,
height: widget.radius * 2,
width: widget.radius * 2,
child: widget.child,
),
);
Expand Down
60 changes: 23 additions & 37 deletions pubspec.lock
@@ -1,20 +1,13 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.2"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.5.0"
version: "2.6.1"
boolean_selector:
dependency: transitive
description:
Expand All @@ -28,7 +21,21 @@ packages:
name: cached_network_image
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0-nullsafety"
version: "3.1.0"
cached_network_image_platform_interface:
dependency: transitive
description:
name: cached_network_image_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
cached_network_image_web:
dependency: transitive
description:
name: cached_network_image_web
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
characters:
dependency: transitive
description:
Expand Down Expand Up @@ -96,14 +103,14 @@ packages:
name: flutter_blurhash
url: "https://pub.dartlang.org"
source: hosted
version: "0.5.4-nullsafety.0"
version: "0.6.0"
flutter_cache_manager:
dependency: transitive
description:
name: flutter_cache_manager
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.0-nullsafety.1"
version: "3.1.2"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -123,13 +130,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
matcher:
dependency: transitive
description:
Expand All @@ -150,7 +150,7 @@ packages:
name: octo_image
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0-nullsafety.1"
version: "1.0.0+1"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -200,13 +200,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.11.0"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.2"
platform:
dependency: transitive
description:
Expand Down Expand Up @@ -246,21 +239,21 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0"
version: "1.8.1"
sqflite:
dependency: transitive
description:
name: sqflite
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0+2"
version: "2.0.0+4"
sqflite_common:
dependency: transitive
description:
name: sqflite_common
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0+1"
version: "2.0.1"
stack_trace:
dependency: transitive
description:
Expand Down Expand Up @@ -302,7 +295,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.19"
version: "0.3.0"
typed_data:
dependency: transitive
description:
Expand Down Expand Up @@ -338,13 +331,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "5.0.2"
sdks:
dart: ">=2.12.0 <3.0.0"
flutter: ">=1.24.0-10.2.pre"
4 changes: 2 additions & 2 deletions pubspec.yaml
@@ -1,6 +1,6 @@
name: circular_profile_avatar
description: CircularProfileAvatar allows developers to implement circular profile avatar with border, overlay, initialsText and many other features which simplifies developer's job.
version: 2.0.1-nullsafety
version: 2.0.2
homepage: https://github.com/ch-muhammad-adil/flutter-circular_profile_avatar

environment:
Expand All @@ -10,7 +10,7 @@ dependencies:
flutter:
sdk: flutter

cached_network_image: ^3.0.0-nullsafety
cached_network_image: ^3.1.0



Expand Down

0 comments on commit fc296b8

Please sign in to comment.