initials_avatar_builder 0.0.4 copy "initials_avatar_builder: ^0.0.4" to clipboard
initials_avatar_builder: ^0.0.4 copied to clipboard

A customizable Flutter widget that automatically generates beautiful circle avatars with user initials and dynamic background colors.

example/lib/main.dart

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Initials Avatar Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text('Default Auto Color:', style: TextStyle(fontWeight: FontWeight.bold)),
              SizedBox(height: 10),
              // Default use (Auto color & standard size)
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  InitialsAvatar(name: 'Shahzain Baloch'),
                  SizedBox(width: 10),
                  InitialsAvatar(name: 'Ali Khan'),
                  SizedBox(width: 10),
                  InitialsAvatar(name: 'Zahra'),
                ],
              ),
              
              SizedBox(height: 30),
              
              Text('Custom Solid Color:', style: TextStyle(fontWeight: FontWeight.bold)),
              SizedBox(height: 10),
              // Custom size aur backgroundColor ke sath
              InitialsAvatar(
                name: 'Shahzain Baloch',
                radius: 40,
                backgroundColor: Colors.black,
              ),

              SizedBox(height: 30),
              
              Text('Custom Gradient:', style: TextStyle(fontWeight: FontWeight.bold)),
              SizedBox(height: 10),
              InitialsAvatar(
                name: 'BalochCodes',
                radius: 50,
                backgroundGradient: LinearGradient(
                  colors: [Colors.purple, Colors.deepOrange],
                  begin: Alignment.topLeft,
                  end: Alignment.bottomRight,
                ),
              ),

              SizedBox(height: 30),
              
              Text('Single Name:', style: TextStyle(fontWeight: FontWeight.bold)),
              SizedBox(height: 10),
              // Sirf ek naam ke sath
              InitialsAvatar(
                name: 'Shahzain',
                radius: 30,
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
160
points
191
downloads

Documentation

API reference

Publisher

verified publisherbalochcodes.com

Weekly Downloads

A customizable Flutter widget that automatically generates beautiful circle avatars with user initials and dynamic background colors.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on initials_avatar_builder