Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev0.1.1

rough

Rough é uma biblioteca que permite desenhar com um estilo rabiscado, semelhante ao desenho feito à mão

Downloads em 30 dias
10
Curtidas
32
Pontos Pub
40

Instalar pacote

flutter pub add rough

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

Rough é uma biblioteca Flutter que permite aos desenvolvedores criar desenhos com estilo rabiscado, feito à mão, em seus aplicativos. Ela imita as imperfeições de rabiscos reais a lápis ou caneta, tornando arte digital mais orgânica e natural. Ideal para funcionalidades interativas de desenho, entradas de assinatura ou elementos de interface artísticos, o Rough oferece uma API simples para renderizar linhas, formas e texto com um visual rústico. A biblioteca é leve e se integra perfeitamente a projetos Flutter por meio do pub.dev.

Casos de uso

  • anotações em estilo desenhado à mão
  • Captura de assinatura digital
  • Elementos de interface do usuário artísticos
  • Interfaces baseadas em esboços
  • Quadros brancos interativos

Principais recursos

  • Renderização de linha desenhada à mão
  • Roughness personalizável
  • Suporte para formas e texto
  • Leve e integração fácil
  • Suporte a esboços em tempo real

Indicado para

  • Desenvolvedores de aplicativos em busca de ferramentas expressivas de desenho
  • Designers que querem visuais orgânicos
  • Aplicativos educacionais com recursos de desenho
  • Prototipagem de esboços interativos

Considerações

  • Limitado a desenho 2D
  • Nenhum ferramenta avançada de edição
  • O desempenho pode variar com cenas complexas
  • Não destinado a gráficos de alta precisão

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

Pub GitHub Release Date GitHub

Rough

Rough is a library that allows you draw in a sketchy, hand-drawn-like style. It's a direct port of Rough.js.

Installation

In the dependencies: section of your pubspec.yaml, add the following line:

dependencies:
  rough: <latest_version>

Basic usage

Right now only drawing via canvas is supported. This is a basic documentation in case you want to play around with Rough. I can't ensure non-breaking changes of the library interface.

To draw a figure you have to:

  1. Create a DrawConfig object to determine how your drawing will look.
  2. Create a Filler to be used when drawing objects (you have to provide a configuration for the filling and a DrawConfig for the filling path).
  3. Create a Generator object using the created DrawConfig and Filler. This will define a drawing/filling style.
  4. Invoke the drawing method from the Generator to create a Drawable.
  5. Paint the Drawable in the canvas using the drawRough method extension for Canvas.

Here an example on how to draw a circle:

//Create a `DrawConfig` object.
DrawConfig myDrawConfig = DrawConfig.build(
  roughness: 3,
  curveStepCount: 14,
  maxRandomnessOffset: 3,
);

//Create a `Filler` with a configuration (we reuse the drawConfig in this case).
FillerConfig myFillerConfig = FillerConfig(
    hachureGap: 8,
    hachureAngle: -20,
    drawConfig: myDrawConfig,
);
Filler myFiller = ZigZagFiller(myFillerConfig);

//Create a `Generator` with the created `DrawConfig` and `Filler`
Generator generator = Generator(
  myDrawConfig,
  myFiller,
);

//4. Build a circle `Drawable`.
Drawable figure = generator.circle(200, 200, 320);

//5. Paint the `Drawable` in the canvas.
Canvas.drawRough(figure, pathPaint, fillPaint);

And this is the result:

Result

Both DrawConfig and FillerConfig will use default values for anything not specified.

Samples

Some screenshots of the example app:

Example 1 Example 2 Example 3 Example 4

Categorias

Repositório-fonte

Projetos que usam este pacote

Ainda não há dados.