Buscar pacotes, repositórios e categorias de apps

Repositório GitHubaloisdeniel/sleek_button

sleek_button

Um botão simples, mas ainda personalizável.

Capa do projeto sleek_button
Estrelas
62
Forks
4
Último push (UTC)
29 de mar. de 2020
Status do projeto
Ativo

README original

Texto original em inglês. Visite o GitHub para a versão atual.

A simple but yet customizable button.

Install

Add the dependency to your pubspec.yaml :

dependencies:
    sleek_button: <version>

Quick start

SleekButton(
    onTap: () {
        print('tapped!');
    },
    style: SleekButtonStyle.flat(
        color: swatch.primary,
        inverted: true,
        rounded: true,
        size: SleekButtonSize.big,
        context: context,
    ),
    child: const Icon(Icons.format_bold),
)

Usage

Widget
SleekButton(
    onTap: () {
        print('tapped!');
    },
    style: <style>
    child: const Text('Save'),,
)
SleekButton(
    onTap: () {
        print('tapped!');
    },
    style: <style>
    child: Row(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
            const Icon(Icons.check),
            const SizedBox(width: 6),
            const Text('Save'),
        ],
    ),
)

If the direct child is an Icon, the button will be a square.

SleekButton(
    onTap: () {
        print('tapped!');
    },
    style: <style>
    child: const Icon(Icons.check),
)
Styles
Flat
SleekButtonStyle.flat(
    context: context,
)
SleekButtonStyle.flat(
    size: SleekButtonSize.small,
    context: context,
)
SleekButtonStyle.flat(
    inverted: true,
    context: context,
)
SleekButtonStyle.flat(
    rounded: true,
    context: context,
)
SleekButtonStyle.flat(
    size: SleekButtonSize.medium,
    rounded: true,
    context: context,
)
Outlined
SleekButtonStyle.outlined(
    context: context,
)
SleekButtonStyle.outlined(
    size: SleekButtonSize.small,
    context: context,
)
SleekButtonStyle.outlined(
    inverted: true,
    context: context,
)
SleekButtonStyle.outlined(
    rounded: true,
    context: context,
)
SleekButtonStyle.outlined(
    size: SleekButtonSize.medium,
    rounded: true,
    context: context,
)
Light
SleekButtonStyle.light(
    context: context,
)
SleekButtonStyle.light(
    size = SleekButtonSize.small,
    context: context,
)
SleekButtonStyle.light(
    rounded = true,
    context: context,
)
SleekButtonStyle.light(
    size: SleekButtonSize.medium,
    rounded = true,
    context: context,
)
Colors

If you give a color, all variants (dark, light, invert) will be calculated with the help of the derived_colors package.

SleekButtonStyle.flat(
    color: const Color(0xFF)
    context: context,
)
 SleekButtonStyle.light(
    color: const Color(0xFFFFC369),
    context: context,
)
SleekButtonStyle.outlined(
    color: const Color(0xFF323232),
    context: context,
)
Theme

You can customize the default appearance of the button by adding a SleekButtonTheme in the tree. If a Theme is in the tree, it will use it tu deduce a default theme.

SleekButtonTheme(
    data: const SleekButtonThemeData(
        padding: 24,
        textStyle: TextStyle(fontSize: 11),
        cornerRadius: 8.0,
        iconTheme: IconThemeData(size: 10),
        fill: Color(0xFFFF0000),
        borderWidth: 2,
    ),
    child: app,
)

Thanks

Thanks to the bulma framework team for the inspiration.

Aloïs Deniel GitHub avatar
Autor no GitHub

Aloïs Deniel ↗

Flutter Freelance

FreelanceRennes, FranceSite oficial ↗
LinguagensDartHTMLKotlinSwiftObjective-C

Categorias

Pacotes publicados por este repositório

Dependências usadas

Lista de dependências 7 itens

Como escolher um repositório para seu projeto?

Filtre pelo caso de uso, compare a atividade e confira o projeto original antes de adotá-lo.

  1. Busque por nome, autor ou descrição e filtre por tema.
  2. Compare estrelas, forks e envios recentes. Estrelas indicam interesse, mas não garantem qualidade.
  3. Confira o README, a licença e as issues no GitHub antes de usar o projeto.

Fontes e manutenção

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗