name_avatar 0.0.1 copy "name_avatar: ^0.0.1" to clipboard
name_avatar: ^0.0.1 copied to clipboard

The NameAvatar widget in Flutter is a versatile widget designed to showcase a circular avatar along with text representing a name. It serves as a convenient tool for showcasing user avatars across dif [...]

example/lib/main.dart

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

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Name Avatar Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const HomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Name Avatar'),
      ),
      body: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            NameAvatar(
              name: 'Dipta Das Suvo',
              radius: 50,
              isTwoChar: true,
            ),
            const SizedBox(
              height: 12,
            ),
            NameAvatar(
              name: 'Emily Patel',
              isTwoChar: true,
            ),
            const SizedBox(
              height: 12,
            ),
            NameAvatar(
              name: 'Isabella Nguyen',
              isTwoChar: false,
            ),
            const SizedBox(
              height: 12,
            ),
            NameAvatar(
              name: 'Xavier',
              isTwoChar: true,
            ),
          ],
        ),
      ),
    );
  }
}
3
likes
140
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

The NameAvatar widget in Flutter is a versatile widget designed to showcase a circular avatar along with text representing a name. It serves as a convenient tool for showcasing user avatars across different applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on name_avatar