Skip to main content

flutter_cache_avatar 0.0.5 copy "flutter_cache_avatar: ^0.0.5" to clipboard
flutter_cache_avatar: ^0.0.5 copied to clipboard

A production-grade cached avatar and image widget for Flutter, seamlessly handling network images, Gravatar, initials fallbacks, and customizable badges.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Cached Avatar Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const DemoPage(),
    );
  }
}

class DemoPage extends StatelessWidget {
  const DemoPage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Flutter Cache Avatar Demo')),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            const Text('Avatar with Badge'),
            const SizedBox(height: 10),
            const CachedAvatar(
              name: 'John Doe',
              size: 80.0,
              colorize: true,
              showBadge: true,
              badgeCount: 5,
            ),
            const SizedBox(height: 30),
            const Text('Initials Fallback (Default size 40px)'),
            const SizedBox(height: 10),
            const CachedAvatar(name: 'Jane Smith', colorize: true),
            const SizedBox(height: 30),
            const Text('Rounded Avatar'),
            const SizedBox(height: 10),
            const CachedAvatar.rounded(
              name: 'Flutter Team',
              size: 60.0,
              radius: 16.0,
              colorize: true,
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
140
points
383
downloads

Documentation

API reference

Publisher

verified publisherfiretell.com

Weekly Downloads

A production-grade cached avatar and image widget for Flutter, seamlessly handling network images, Gravatar, initials fallbacks, and customizable badges.

Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

cached_network_image, crypto, flutter

More

Packages that depend on flutter_cache_avatar