user_profile_avatar 0.1.2 copy "user_profile_avatar: ^0.1.2" to clipboard
user_profile_avatar: ^0.1.2 copied to clipboard

A simple widget that display round profile picture and display native circular progress indicator whilst image is being fetched.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:user_profile_avatar/user_profile_avatar.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        body: HomePage(),
      ),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: UserProfileAvatar(
        avatarUrl: 'https://picsum.photos/id/237/5000/5000',
        onAvatarTap: () {
          ScaffoldMessenger.of(context).showSnackBar(
            const SnackBar(
              content: Text('Tapped on avatar'),
            ),
          );
        },
        notificationCount: 10,
        notificationBubbleTextStyle: const TextStyle(
          fontSize: 30,
          color: Colors.white,
          fontWeight: FontWeight.bold,
        ),
        avatarSplashColor: Colors.purple,
        radius: 100,
        isActivityIndicatorSmall: false,
        avatarBorderData: AvatarBorderData(
          borderColor: Colors.black54,
          borderWidth: 5.0,
        ),
      ),
    );
  }
}
33
likes
130
pub points
79%
popularity

Publisher

unverified uploader

A simple widget that display round profile picture and display native circular progress indicator whilst image is being fetched.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

cached_network_image, flutter

More

Packages that depend on user_profile_avatar