Aus öffentlichen Paketdaten erstellte Orientierung.
ResponsiveSpacing ist ein Flutter/Dart-Paket, das Entwicklern ermöglicht, anpassbare und responsive Benutzeroberflächen zu erstellen, indem Abstände, Ränder, Paddings, Spaltenabstände, Textgrößen und Spaltenlayouts dynamisch basierend auf der Bildschirmgröße angepasst werden. Es vereinfacht die responsive Gestaltung über mehrere Plattformen hinweg, einschließlich Android, iOS, Web, macOS, Windows und Linux. Durch die Verwendung eingebauter responsive Einheiten und Breakpoints stellt es sicher, dass die UI konsistent bleibt, unabhängig von den Geräteabmessungen. Ideal für Apps, die flexible Layouts erfordern, ohne wiederholte Media-Query-Logik schreiben zu müssen.
Anwendungsfälle
Cross-Platform-Responsive-Layouts erstellen
Anpassen der Benutzeroberfläche für verschiedene Bildschirmgrößen
Erstellen von flüssigen Gittersystemen
Automatisierung von Padding- und Margin-Anpassungen
Skalierbare mobile und Web-Oberflächen gestalten
Hauptmerkmale
Dynamische Abstände basierend auf der Bildschirmgröße
Eingebaute responsive Breakpoints
Unterstützung für Ränder, Abstände und Spalten
Plattformübergreifende Kompatibilität
Einfache Integration mit bestehenden Flutter-Widgets
Flexible Spalten- und Body-Größensteuerung
Geeignet für
Entwickler, die responsive Flutter-Apps erstellen
Teams, die mehrere Plattformen ansprechen
UI-Designer, die sich auf Anpassungsfähigkeit konzentrieren
Projekte, die skalierbare Layout-Systeme erfordern
Apps mit komplexen responsiven Anforderungen
Hinweise
Kann für neue Benutzer eine anfängliche Lernkurve erfordern
Leistungsbeeinträchtigung bei sehr großen Widget-Bäumen
Abhängig von der genauen Bildschirmgrößen-Erkennung
Am besten mit einem konsistenten Design-System verwenden
Eingeschränkte Anpassung über die bereitgestellten responsiven Einheiten hinaus
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
This plugin helps to design and develop beautiful responsive and adaptive flutter apps.
Lightweight, Responsive Spacing
All design principles have roughly the same elements. For example, Material Design works with margin, gutter, body and has a responsive 12 column system.
Our default values are set by the Material Design Guidelines, but you can also easily set your own breakpoints, margins, and spacing.
You can find spacings everywhere in your Project, don't use Magic Numbers, use the context-oriented spacing class instead.
We have developed this plugin so that you can easily make your app adaptive and responsive.
Simple Spacing
Access your own Spacing-System:
// Example values for a Pixel 7 Pro
context.spacing.xs; // default 2
context.spacing.s; // default 8
context.spacing.m; // default 12
context.spacing.l; // default 16
context.spacing.xl; // default 32
context.spacing.xxl; // default 56// Example:// Instead of SizedBox(height: 8);
// useSizedBox(height: context.spacing.s); // Wow!
And whenever your design guru wants to modify the values, you only have to modify it in a single file.
Giga Spacing for all design chads that need more power
Design Gurus are around the world and you will maybe find one in your own company. If you have such a mysterious creature, use the Giga Spacing class for even more fine tuning.
In the previous Example, we used the any override, this will ignore the layout width. If you want to make the spacings responsive, override the values for xl, lg, md, sm2, sm1 & xs
And in your Widget, access the Spacing class with Spacing.of(context) or context.spacingConfig which returns an object of ResponsiveData. The object has all necessary spacings.
context.spacingConfig.margin;
context.spacingConfig.padding;
context.spacingConfig.gutter;
context.spacingConfig.body;
context.spacingConfig.layoutColumns;
// You are now good to use these properties in your layout.
For example with a Card:
Card(
// use margin
margin: context.spacingConfig.margin.horizontalEdgeInsets,
child: Padding(
// use padding
padding: context.spacingConfig.padding.allEdgeInsets,
child: Column(
children: [
Text("This is a Title"),
Text("This is the subtitle, usually you explain something")
],
),
),
)
Columns, Gutters & Margins
The responsive layout grid is made up of three elements: columns, gutters, and margins. Read everything about Columns, Gutters & Margins on the material guidelines responsive layout page.
Example: Access global padding setting in your widget:
Spacing.of(context).padding
// or
context.spacingConfig.padding
Just like the custom breakpoints, you can also set your own spacing, spaces, and margins. Create your own gutter class by extending ResponsiveCollection:
There are two types of widgets, the data widgets that create the spacing context and widgets that use the spacing context.
Data Widgets
Data widgets create the spacing context and provide responsive values to all widgets created in the tree below. if there are multiple data widgets in the tree, the closest one is taken.