StoryRecupAvatar constructor

StoryRecupAvatar()

Implementation

StoryRecupAvatar()
    : super(
        name: 'DataDisplay/RecupAvatar',
        builder: (context) {
          const photo =
              "https://images.unsplash.com/photo-1658459239113-39cc85f15154?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1374&q=80";
          return SizedBox(
            width: double.infinity,
            height: double.infinity,
            child: Center(
              child: RecupAvatar(
                foto: photo,
                backgroundColor: context.knobs.nullable.options(
                  label: 'backgroundColor',
                  initial: Colors.orange,
                  enabled: false,
                  description: 'Define a cor de fundo',
                  options: const [
                    Option(
                      label: 'deepPurple',
                      value: Colors.deepPurple,
                    ),
                    Option(
                      label: 'primary',
                      value: Colors.green,
                    ),
                  ],
                ),
                active: context.knobs.boolean(
                  label: 'active',
                  initial: false,
                  description: 'Define se está ativo ou não',
                ),
                size: context.knobs.nullable.options(
                  label: 'size',
                  initial: RecupAvatarSize.medium,
                  description: 'Define o tamanho do avatar',
                  options: const [
                    Option(
                      label: 'small',
                      value: RecupAvatarSize.small,
                    ),
                    Option(
                      label: 'medium',
                      value: RecupAvatarSize.medium,
                    ),
                    Option(
                      label: 'large',
                      value: RecupAvatarSize.large,
                    ),
                  ],
                ),
              ),
            ),
          );
        },
      );