avatar_profile 0.0.1
avatar_profile: ^0.0.1 copied to clipboard
A customizable Flutter avatar profile picker widget with built-in avatar images and bottom sheet selection.
example/lib/main.dart
import 'package:avatar_profile/avatar_profile.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: AvatarExamplePage(),
);
}
}
class AvatarExamplePage extends StatefulWidget {
const AvatarExamplePage({super.key});
@override
State<AvatarExamplePage> createState() => _AvatarExamplePageState();
}
class _AvatarExamplePageState extends State<AvatarExamplePage> {
String? selectedAvatar;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Avatar Profile Example')),
body: Center(
child: AvatarProfile(
displayUrl: selectedAvatar,
onAvatarSelected: (url) {
setState(() {
selectedAvatar = url;
});
},
),
),
);
}
}