{"id":32274718,"url":"https://github.com/mohamedmaher-dev/my_profile_avatar","last_synced_at":"2026-02-21T16:01:22.354Z","repository":{"id":317936637,"uuid":"1069444467","full_name":"mohamedmaher-dev/my_profile_avatar","owner":"mohamedmaher-dev","description":"A customizable Flutter package for displaying profile avatars with support for network images, local files, name initials, and placeholder icons.","archived":false,"fork":false,"pushed_at":"2025-10-04T00:29:22.000Z","size":485,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-04T01:39:38.779Z","etag":null,"topics":["avatar-component","avatar-library","avatar-widget","avatars","dart","flutter","flutter-package","flutter-ui","image-widget","initials-avatar","placeholders","profile-avatar","profile-picture","ui-widget","user-avatar"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohamedmaher-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T00:29:19.000Z","updated_at":"2025-10-04T00:34:26.000Z","dependencies_parsed_at":"2025-10-04T01:39:40.739Z","dependency_job_id":"96138e84-6425-4ae5-a114-512e8be1a732","html_url":"https://github.com/mohamedmaher-dev/my_profile_avatar","commit_stats":null,"previous_names":["mohamedmaher-dev/my_profile_avatar"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mohamedmaher-dev/my_profile_avatar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmaher-dev%2Fmy_profile_avatar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmaher-dev%2Fmy_profile_avatar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmaher-dev%2Fmy_profile_avatar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmaher-dev%2Fmy_profile_avatar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohamedmaher-dev","download_url":"https://codeload.github.com/mohamedmaher-dev/my_profile_avatar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohamedmaher-dev%2Fmy_profile_avatar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29685020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avatar-component","avatar-library","avatar-widget","avatars","dart","flutter","flutter-package","flutter-ui","image-widget","initials-avatar","placeholders","profile-avatar","profile-picture","ui-widget","user-avatar"],"created_at":"2025-10-22T23:39:07.296Z","updated_at":"2026-02-21T16:01:22.349Z","avatar_url":"https://github.com/mohamedmaher-dev.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My Profile Avatar\n\n[![pub package](https://img.shields.io/pub/v/my_profile_avatar.svg)](https://pub.dev/packages/my_profile_avatar)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Flutter](https://img.shields.io/badge/Flutter-%2302569B.svg?style=flat\u0026logo=Flutter\u0026logoColor=white)](https://flutter.dev)\n\nA customizable Flutter package for displaying profile avatars with support for multiple image sources including network images, local files, name initials, and placeholder icons.\n\n## ✨ Features\n\n- 🌐 **Network Images**: Display avatars from URLs with built-in caching support\n- 📁 **Local Files**: Load avatar images from device storage\n- 🔤 **Name Initials**: Generate text-based avatars from user names\n- 🎭 **Placeholder Icons**: Show default avatar icons when no image is available\n- 🎨 **Customizable Styling**: Control size, colors, and border radius\n- ⏳ **Loading States**: Built-in loading indicators for network images\n- 🛡️ **Error Handling**: Graceful fallbacks when images fail to load\n- 📱 **Platform Support**: Works on iOS, Android, Web, and Desktop\n\n## 📱 Screenshots\n\n| Demo App Overview                                      | Interactive Controls                                       |\n| ------------------------------------------------------ | ---------------------------------------------------------- |\n| ![Demo](assets/screenshot-2025-10-04_03.26.11.787.png) | ![Controls](assets/screenshot-2025-10-04_03.26.15.196.png) |\n\n## 🚀 Getting Started\n\n### Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  my_profile_avatar: ^1.0.0\n```\n\nThen run:\n\n```bash\nflutter pub get\n```\n\n### Import\n\n```dart\nimport 'package:my_profile_avatar/my_profile_avatar.dart';\n```\n\n## 📖 Usage\n\n### Basic Usage\n\n```dart\nMyProfileAvatar(\n  style: MyProfileAvatarStyle(\n    size: 60,\n    color: Colors.blue,\n    radius: 30,\n  ),\n  urlImage: 'https://example.com/avatar.jpg',\n)\n```\n\n### Different Avatar Types\n\n#### Network Image Avatar\n\n```dart\nMyProfileAvatar(\n  style: MyProfileAvatarStyle(\n    size: 80,\n    color: Colors.blue,\n    radius: 40,\n  ),\n  urlImage: 'https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg',\n)\n```\n\n#### Name Initials Avatar\n\n```dart\nMyProfileAvatar(\n  style: MyProfileAvatarStyle(\n    size: 60,\n    color: Colors.green,\n    radius: 30,\n  ),\n  name: 'John Doe',\n)\n```\n\n#### Local File Avatar\n\n```dart\nMyProfileAvatar(\n  style: MyProfileAvatarStyle(\n    size: 100,\n    color: Colors.purple,\n    radius: 50,\n  ),\n  pathImage: '/path/to/local/image.jpg',\n)\n```\n\n#### Placeholder Avatar\n\n```dart\nMyProfileAvatar(\n  style: MyProfileAvatarStyle(\n    size: 50,\n    color: Colors.grey,\n    radius: 25,\n  ),\n  // No image sources provided - shows placeholder\n)\n```\n\n### Using the Type Factory Constructor\n\nFor more explicit control over avatar types:\n\n```dart\n// Network image avatar\nMyProfileAvatar.type(\n  type: MyProfileAvatarType.network,\n  value: 'https://example.com/avatar.jpg',\n  style: MyProfileAvatarStyle(\n    size: 60,\n    color: Colors.blue,\n  ),\n)\n\n// Name initials avatar\nMyProfileAvatar.type(\n  type: MyProfileAvatarType.name,\n  value: 'Alice Johnson',\n  style: MyProfileAvatarStyle(\n    size: 80,\n    color: Colors.green,\n  ),\n)\n```\n\n### Styling Options\n\nThe `MyProfileAvatarStyle` class provides extensive customization options:\n\n```dart\nMyProfileAvatarStyle(\n  size: 100,        // Width and height in logical pixels\n  color: Colors.blue, // Primary color for text, icons, and loading indicators\n  radius: 50,       // Border radius (50 = perfect circle for size 100)\n)\n```\n\n#### Common Styling Patterns\n\n```dart\n// Perfect circle\nMyProfileAvatarStyle(\n  size: 80,\n  color: Colors.blue,\n  radius: 40, // Half of size\n)\n\n// Rounded square\nMyProfileAvatarStyle(\n  size: 60,\n  color: Colors.green,\n  radius: 12,\n)\n\n// Sharp square\nMyProfileAvatarStyle(\n  size: 50,\n  color: Colors.red,\n  radius: 0,\n)\n```\n\n## 🔄 Priority System\n\nThe widget automatically determines which content to display based on this priority order:\n\n1. **Local File** (`pathImage`) - Highest priority\n2. **Network Image** (`urlImage`)\n3. **Name Initials** (`name`)\n4. **Placeholder Icon** - Lowest priority (fallback)\n\n```dart\nMyProfileAvatar(\n  style: MyProfileAvatarStyle(color: Colors.blue),\n  pathImage: '/local/image.jpg',    // This will be shown\n  urlImage: 'https://example.com/avatar.jpg', // Ignored\n  name: 'John Doe',                 // Ignored\n)\n```\n\n## 🛠️ Advanced Usage\n\n### Custom Error Handling\n\nThe widget includes built-in error handling, but you can also check the avatar type programmatically:\n\n```dart\nfinal avatar = MyProfileAvatar(\n  style: MyProfileAvatarStyle(color: Colors.blue),\n  urlImage: 'https://example.com/avatar.jpg',\n);\n\n// Check what type will be displayed\nfinal avatarType = avatar.getType(); // MyProfileAvatarType.network\nfinal avatarValue = avatar.getValue(); // 'https://example.com/avatar.jpg'\n```\n\n### Integration with User Profiles\n\n```dart\nclass UserProfile extends StatelessWidget {\n  final User user;\n\n  const UserProfile({required this.user, super.key});\n\n  @override\n  Widget build(BuildContext context) {\n    return Column(\n      children: [\n        MyProfileAvatar(\n          style: MyProfileAvatarStyle(\n            size: 120,\n            color: Theme.of(context).primaryColor,\n            radius: 60,\n          ),\n          urlImage: user.profileImageUrl,\n          name: user.fullName,\n        ),\n        const SizedBox(height: 16),\n        Text(user.fullName, style: Theme.of(context).textTheme.headlineSmall),\n      ],\n    );\n  }\n}\n```\n\n## 📋 API Reference\n\n### MyProfileAvatar\n\n| Parameter   | Type                   | Description                                        |\n| ----------- | ---------------------- | -------------------------------------------------- |\n| `style`     | `MyProfileAvatarStyle` | **Required.** Styling configuration for the avatar |\n| `name`      | `String?`              | Optional name to display as initials               |\n| `urlImage`  | `String?`              | Optional URL for network image                     |\n| `pathImage` | `String?`              | Optional path to local image file                  |\n\n### MyProfileAvatarStyle\n\n| Parameter | Type     | Default      | Description                                   |\n| --------- | -------- | ------------ | --------------------------------------------- |\n| `color`   | `Color`  | **Required** | Primary color for text, icons, and indicators |\n| `size`    | `double` | `50.0`       | Width and height in logical pixels            |\n| `radius`  | `double` | `100.0`      | Border radius for rounded corners             |\n\n### MyProfileAvatarType\n\n| Value         | Description              |\n| ------------- | ------------------------ |\n| `placeholder` | Default placeholder icon |\n| `network`     | Network image from URL   |\n| `file`        | Local file image         |\n| `name`        | Name initials as text    |\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n### Development Setup\n\n1. Fork the repository\n2. Clone your fork: `git clone https://github.com/mohamedmaher-dev/my_profile_avatar.git`\n3. Create a feature branch: `git checkout -b feature/amazing-feature`\n4. Make your changes and add tests\n5. Run tests: `flutter test`\n6. Commit your changes: `git commit -m 'Add amazing feature'`\n7. Push to the branch: `git push origin feature/amazing-feature`\n8. Open a Pull Request\n\n## 🐛 Issues\n\nIf you encounter any issues or have feature requests, please file them in the [issues section](https://github.com/mohamedmaher-dev/my_profile_avatar/issues).\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\n- Built with ❤️ using [Flutter](https://flutter.dev)\n- Network image caching powered by [cached_network_image](https://pub.dev/packages/cached_network_image)\n- Icons from [Cupertino Icons](https://pub.dev/packages/cupertino_icons)\n\n---\n\n**Made with ❤️ for the Flutter community**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamedmaher-dev%2Fmy_profile_avatar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohamedmaher-dev%2Fmy_profile_avatar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohamedmaher-dev%2Fmy_profile_avatar/lists"}