online_indicator 0.0.3

SDKflutter
Platformandroidioswindowslinuxmacosweb

A simple and customizable Flutter widget to display an online status indicator, perfect for chat apps or social profiles. Easily adjust size, colors, borders, and integrate seamlessly into your UI.

online_indicator

A simple Flutter widget to display an online status indicator, ideal for user profile images, avatars, or contact lists.

Features

  • Display a small online indicator over any widget (typically an avatar).
  • Customizable size, colors, border width, and icon.
  • Lightweight and easy to integrate.

Getting Started

Add online_indicator to your pubspec.yaml:

dependencies:
  online_indicator: latest_version

Then import it:

import 'package:online_indicator/online_indicator.dart';

Usage

Wrap the OnlineIndicator inside a Stack positioned over the widget you want to show the indicator on.

Stack(
  children: [
    CircleAvatar(
      radius: 30,
      backgroundImage: NetworkImage('https://example.com/avatar.jpg'),
    ),
    const OnlineIndicator(
      isOnline: true,
      radius: 12.0,
      borderWide: 2.0,
      bgColor: Colors.green,
      borderColor: Colors.white,
    ),
  ],
)

Parameters

ParameterTypeDescription
isOnlineboolWhether the user is online (show the indicator) or not.
iconDataIconData?Optional: Custom icon inside the indicator.
bgColorColor?Background color of the indicator. Defaults to the theme's primary color.
iconColorColor?Color of the icon if provided.
radiusdoubleSize of the online indicator.
borderWidedoubleWidth of the border around the indicator.
borderColorColor?Color of the border. Defaults to transparent.

Example

Example Preview

License

MIT License


Maintained with ❤️ by your package authors.