avataaars 0.5.1 copy "avataaars: ^0.5.1" to clipboard
avataaars: ^0.5.1 copied to clipboard

An avatar generator for anyone to make their beautiful personal avatar easily!

example/lib/main.dart

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

import 'avatar_customizer.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key, required this.title}) : super(key: key);

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  Avataaar avataaar = Avataaar.random();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Avataaars')),
      body: SingleChildScrollView(
        child: Column(crossAxisAlignment: CrossAxisAlignment.center, children: [
          Container(
              padding: const EdgeInsets.all(10),
              constraints: const BoxConstraints(maxWidth: 600),
              child: AvatarCustomizer(
                initialValue: avataaar,
                onChanged: (a) => setState(() {
                  avataaar = a;
                }),
              ))
        ]),
      ),
    );
  }
}
24
likes
120
pub points
64%
popularity

Publisher

verified publisherteavelopment.com

An avatar generator for anyone to make their beautiful personal avatar easily!

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_localizations, freezed_annotation

More

Packages that depend on avataaars