alphatar 0.1.0 copy "alphatar: ^0.1.0" to clipboard
alphatar: ^0.1.0 copied to clipboard

Create an avatar with the initials of your text.

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Alphatar example app'),
        ),
        body: Center(
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              Alphatar(
                initials: "John Doe",
                borderRadius: BorderRadius.circular(10),
              ),
              Alphatar(
                initials: "Erick",
                backgroundColor: Colors.grey,
                borderRadius: BorderRadius.zero,
                onTap: () => print("Hi, bro!"),
              ),
              Alphatar(
                initials: "R. Richard Nowel",
                backgroundColor: Colors.orange,
              ),
              Alphatar(
                initials: "Smith",
                backgroundColor: Colors.pinkAccent,
                border: Border.all(
                  color: Colors.blue,
                  width: 2,
                ),
                borderRadius: BorderRadius.zero,
              ),
              Alphatar(
                initials: "Alice",
                backgroundColor: Colors.purple[900],
                borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(10.0),
                  bottomRight: Radius.circular(10.0),
                ),
                onTap: () => print("Awesome!"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
2
likes
30
points
18
downloads

Publisher

verified publishershasmatic.site

Weekly Downloads

Create an avatar with the initials of your text.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on alphatar