Pakete, Repositories und App-Kategorien suchen

Cover von figma_layout_grid
Paketdetailsv0.3.2

figma_layout_grid

Visuelle Hilfegrid-System, das Figma-Layout-Grid-Funktionen unterstützt

AndroidiOSWebmacOSWindowsLinux
30-Tage-Downloads
108
Likes
32
Pub-Punkte
160

Paket installieren

flutter pub add figma_layout_grid

Paketübersicht

Aus öffentlichen Paketdaten erstellte Orientierung.

Ein Flutter-Paket, das das Layout-Raster-System von Figma als visuelle Hilfestellung implementiert und Entwicklern hilft, UI-Elemente konsistent mit Designvorgaben auszurichten. Es unterstützt Figma-Grid-Funktionen wie Spaltenanzahl, Randgröße und Versatz und ermöglicht eine präzise Anpassung der Layouts zwischen Design und Implementierung. Das Raster wird als Overlay auf dem Bildschirm angezeigt, was es ideal für Prototyping und Entwicklung macht. Kompatibel mit allen wichtigen Plattformen verbessert es die Zusammenarbeit zwischen Designern und Entwicklern, indem es die Lücke zwischen Figma-Designs und Live-Flutter-Apps schließt.

Anwendungsfälle

  • Übereinstimmung von Figma-Designs in Flutter-Apps
  • Prototyping mit visueller Rasterausrichtung
  • Zusammenarbeit zwischen Designern und Entwicklern
  • Konsistente Abstände in UI-Layouts sicherstellen
  • Visuelle Debugging von Layoutbeschränkungen

Hauptmerkmale

  • Figma-inspiriertes Rastersystem
  • Echtzeit-Visualisierungs-Gitterüberlagerung
  • Unterstützt Spalten, Ränder und Verschiebungen
  • Plattformübergreifende Kompatibilität
  • Einfache Integration über pub add
  • Anpassbare Rasterdarstellung

Geeignet für

  • Designer, die mit Flutter arbeiten
  • Flutter-Entwickler, die Figma-Designs folgen
  • Teams, die Figma für UI/UX-Arbeitsabläufe nutzen
  • Projekte, die eine pixelgenaue Layoutausrichtung erfordern
  • Frontend-Teams, die sich auf Designkonsistenz konzentrieren

Hinweise

  • Raster dient nur der visuellen Hilfe, nicht zur Layoutlogik
  • Nicht für die Produktionsschnittstellen-Rendern vorgesehen
  • Kann die Leistung beeinträchtigen, wenn sie übermäßig verwendet wird
  • Soll in Release-Builds deaktiviert sein
  • Benötigt manuelle Konfiguration für verschiedene Bildschirme

Original-README

Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.

Figma layout grid

pub package  

figma_layout_grid is a Flutter package which imitates Figma's layout grid and all its functionalities. It helps you determine whether your UI components match the design file and align properly.

Basic usage

Wrap a widget with LayoutGrid in order to render a layout grid on top of it.

LayoutGrid(
    ...
    builder: (context) => Scaffold(),
)

Available layouts

This package supports three types of layout overlays - rows, columns and pixel grid.

Rows

Horizontal stripes with specified height, gutter, margin, offset, arrangement and color. There is a possibility for fixed rows count with passing desired number in a count parameter, otherwise rows are rendered dynamically due to the screen limits.

Example usage

LayoutGrid(
  ...
  rowsParams: const RowsParams(
    offset: 32.0,
    height: 16.0,
    gutter: 16.0,
  ),
  builder: (context) => Scaffold(),
),
rows example image
Columns

Vertical stripes with specified height, gutter, margin, offset, arrangement and color. There is a possibility for fixed columns count with passing desired number in a count parameter, otherwise columns are rendered dynamically due to the screen limits.

Example usage

LayoutGrid(
  ...
  columnsParams: const ColumnsParams(
    count: 4,
    width: 64.0,
    margin: 32.0,
  ),
  builder: (context) => Scaffold(),
),
columns example image
Grid

Square pixel grid with fixed spacing and color. The thickness of a grid is set to 1.

Example usage

LayoutGrid(
  ...
  gridParams: const GridParams(
    size: 50.0,
    color: Colors.black26,
  ),
  builder: (context) => Scaffold(),
),
grid example image

State management

By default all of the layouts are disabled. In order to manage layout grid state you may use LayoutGrid methods which are accessible via builder context.

Rows

void LayoutGrid.of(context).showRows() - shows row layout

void LayoutGrid.of(context).hideRows() - hides row layout

void LayoutGrid.of(context).toggleRows() - toggles row layout visibility

bool LayoutGrid.of(context).visibleRows - returns current row layout visibility state

Columns

void LayoutGrid.of(context).showColumns() - shows column layout

void LayoutGrid.of(context).hideColumns() - hides column layout

void LayoutGrid.of(context).toggleColumns() - toggles column layout visibility

bool LayoutGrid.of(context).visibleColumns - returns current column layout visibility state

Grid

void LayoutGrid.of(context).showGrid() - shows grid layout

void LayoutGrid.of(context).hideGrid() - hides grid layout

void LayoutGrid.of(context).toggleGrid() - toggles grid layout visibility

bool LayoutGrid.of(context).visibleGrid - returns current grid layout visibility state

Parametrization

As this package mimics Figma's layout grid features you can directly transfer desired outcome into corresponding parameters. The following example shows columns grid set with count = 10, height = 12, gutter = 12, offset = 24, bottom alignment and some custom color.

figma layout configuration

Which translates to this piece of code

LayoutGrid(
  ...
  rowsParams: RowsParams(
    count: 10,
    height: 12.0,
    gutter: 12.0,
    offset: 24.0,
    arrangement: RowsArragement.bottom,
    color: const Color(0xFF757975).withOpacity(0.15),
  ),
  builder: (context) => Scaffold(),
),

And finally to the following UI.

custom config

There is also a possibility to enable SafeArea for a specific layout.

Each of the three layers has optional SafeAreaParams within you can pass what SafeArea parts should be handled. The available options are top, bottom, left and right which correspond to SafeArea's parameters with the same names.

By default SafeArea feature is disabled.

LayoutGrid(
    ...
    rowsParams: const RowsParams(
      safeAreaParams: SafeAreaParams(
        bottom: true,
        top: true,
      ),
    ),
    columnsParams: const ColumnsParams(
      safeAreaParams: SafeAreaParams(
        right: true,
        left: true,
        top: true,
      ),
    ),
    builder: (context) => Scaffold(),
)

The above snippet will make the grid overlays avoid the device's intrusions.

safe area config

Demo

Try out the example app.

Kategorien

Quell-Repository

Projekte, die dieses Paket verwenden

Noch keine Daten verfügbar.