onCreated property
Called when the avatar is created.
You can use the NotionAvatarController to control the avatar.
- NotionAvatarController.random to random the avatar.
- NotionAvatarController.setAccessories to set the accessories.
- NotionAvatarController.setBeard to set the beard.
- NotionAvatarController.setDetails to set the details.
- NotionAvatarController.setEyebrows to set the eyebrows.
- NotionAvatarController.setEyes to set the eyes.
- NotionAvatarController.setFace to set the face.
- NotionAvatarController.setGlasses to set the glasses.
- NotionAvatarController.setHair to set the hair.
- NotionAvatarController.setMouth to set the mouth.
- NotionAvatarController.setNose to set the nose.
NotionAvatarController? controller;
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: SizedBox(
width: 300,
height: 300,
child: NotionAvatar(
useRandom: true, // random when created
onCreated: (NotionAvatarController controller) {
this.controller = controller;
// this.controller?.random();
},
),
),
),
),
);
}
Implementation
final void Function(NotionAvatarController controller)? onCreated;