搜索插件、代码仓与 APP 分类

super_profile_picture 封面
插件详情v1.0.0

super_profile_picture

一个可自定义的 Flutter 小部件,用于显示个人资料图片,支持图像和文本选项。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
33
喜欢数
11
Pub 分数
150

安装插件

flutter pub add super_profile_picture

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Super Profile Picture 是一个可自定义的 Flutter 小部件,旨在显示带有图像和文本头像的个人资料图片。它提供灵活的样式、形状选项以及在图像不可用时的动态回退功能。适用于社交应用、聊天平台或仪表板中的用户界面,确保在各种设备上保持一致的视觉呈现。该小部件可无缝集成到 Flutter 项目中,并支持所有主要平台,包括 Android、iOS、Web、macOS、Windows 和 Linux。

适合场景

  • 用户资料展示
  • 聊天界面
  • 仪表板小部件
  • 社交媒体应用
  • 团队成员列表

主要特点

  • 图像和文本头像支持
  • 可自定义的形状和尺寸
  • 缺失图片的备用文本
  • 平台无关设计
  • 与 Flutter 的轻松集成
  • 响应式布局处理

适合对象

  • 开发社交应用的开发者
  • 需要一致头像的UI设计师
  • 需要跨平台兼容性的项目
  • 带有用户资料或消息功能的应用程序
  • 希望拥有可复用头像组件的团队

使用建议

  • 需要为远程 URL 设置图像加载
  • 仅限基础头像功能
  • 无内置的从姓名生成头像功能
  • 可能需要额外的样式来处理复杂的用户界面
  • 依赖外部图像加载库

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

logo

License: MIT pub package GitHub popularity version

A customizable Flutter widget for displaying profile pictures, supporting both image and text options. It will show label text in case the image is not provided or fails to load. You can use any image provider, such as NetworkImage, AssetImage, and more, to display the image.

Live Demo & Experiment Page

Live demo: Demo & Experiment site

Installation

i. Add the latest version of this package to your pubspec.yaml file, and run: 'dart pub get':

dependancies:
  super_profile_picture: ^1.0.0

ii. Import the package in your Flutter App and use it.

import 'package:super_profile_picture/super_profile_picture.dart';

Note

The background color will be set according to the first letter of the label. Customization of the background color is not currently supported but may be added in the future.

Code Sample

Default

Screenshot_161 Screenshot_160

SuperProfilePicture(
    label: "Super Profile Picture",
    radius: 30,
);
SuperProfilePicture(
    label: "Super Profile Picture",
    radius: 30,
    image: NetworkImage("https://picsum.photos/200/300.jpg"),

);
Max Label Length

Screenshot_162


SuperProfilePicture(
    label: "Super Profile Picture",
    radius: 30,
    textDecorationProperties: TextDecorationProperties(
         maxLabelLength: 3,  
    ),
);
Empty Name / Blank

Screenshot_163

SuperProfilePicture(
    label: "",
    radius: 30,
);
With Border

Screenshot_164 Screenshot_165

SuperProfilePicture(
    label: "Super Profile Picture",
    radius: 30,
    border: Border.all(width: 6, color: Colors.blue),
);
SuperProfilePicture(
    label: "Super Profile Picture",
    radius: 30,
    image: NetworkImage("https://picsum.photos/200/300.jpg"),
    border: Border.all(width: 6, color: Colors.blue),

);

Properties

  • label
  • radius
  • textDecorationProperties
    • fontSize;
    • maxLabelLength;
    • useFittedBox;
    • fontColor;
    • fontWeight;
    • letterSpacing;
    • padding;
    • fontStyle;
  • imageDecorationProperties
    • frameBuilder;
    • loadingBuilder;
    • errorBuilder;
    • semanticLabel;
    • excludeFromSemantics;
    • width;
    • height;
    • color;
    • opacity;
    • colorBlendMode;
    • fit;
    • alignment;
    • repeat;
    • centerSlice;
    • matchTextDirection;
    • gaplessPlayback;
    • isAntiAlias;
    • filterQuality;
  • border
  • borderRadius
  • image
  • clipBehavior

Future Tasks

  • Add customizable background color function.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。