Fügt Flutter-basierten Textfeldern, Schaltflächen und anderen Steuerelementen zusätzliche Dekoration hinzu. Dadurch wird eine bessere Anpassung der Benutzeroberfläche ermöglicht.
Aus öffentlichen Paketdaten erstellte Orientierung.
ControlStyle ist ein Flutter-Paket, das die visuelle Erscheinung von Benutzeroberflächensteuerelementen wie Textfeldern und Schaltflächen durch anpassbare Dekorationen verbessert. Es ermöglicht Entwicklern, das Aussehen und Gefühl standardmäßiger Widgets einfach anzupassen, ohne wiederholten Stilcode schreiben zu müssen. Mit Unterstützung für alle wichtigen Plattformen vereinfacht es die Anpassung der Benutzeroberfläche für konsistente, professionelle Designs. Das Paket lässt sich über einen einfachen pub add-Befehl nahtlos in bestehende Flutter-Projekte integrieren.
Anwendungsfälle
Anpassen von Textfeld-Rändern
Verbesserung der Buttonästhetik
Erstellen einheitlicher UI-Themen
Verbesserung der Formular-Eingabevisualisierung
Designkonsistenz vereinfachen
Dekorative Effekte zu Steuerelementen hinzufügen
Hauptmerkmale
Einfache Integration mit Flutter-Widgets
Plattformübergreifende Kompatibilität
Erweiterbares Dekorationssystem
Minimale Boilerplate-Anforderung
Unterstützt responsive Design
Themengebundene Gestaltung
Geeignet für
UI-Designer, die auf visuelle Perfektion abzielen
Entwickler, die Formulare erstellen
Teams, die konsistente Designsysteme pflegen
Apps mit benutzerdefinierten Steuerelement-Aussehen
Projekte mit engen UI-Fristen
Flutter-Anfänger erkunden Widget-Styling
Hinweise
Kann zusätzliche Konfiguration für komplexe Layouts erfordern
Beschränkt auf visuelle Verbesserungen (keine funktionalen Änderungen)
Abhängig von Flutter's Rendering-Pipeline
Möglicher Leistungseinbruch bei vielen dekorierten Steuerelementen
Nicht geeignet für nicht-visuelle Anpassungsanforderungen
Erfordert Verständnis des Widgetbaums von Flutter
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
Applies additional appearance settings to Flutter text fields, buttons and other controls. Currently supports: outer shadow, inner shadow, border, inner gradient.
The Flutter library provides limited opportunities to set up the appearance of controls. You usually make this customisation by wrapping the components into a Container widget and configuring it using the decoration parameter. Such an approach has limitations as it leads to increasing the volume of work and complicating the code. Especially time consuming in this case is creating animations for switching between different appearances depending on a state of a control.
In addition, this approach works incorrectly when you are adding shadows to text fields in combination with errorText and helperText:
This package helps to solve the aforementioned problem. It provides the most common customisation features for control elements which have shape field such as buttons, text fields, Card, Chip, Checkbox, Dialog, Drawer, inks, ListTile, Material, NavigationBar.
The package provides the same customisation parameters to all controls, which allows for identically decorating any of the controls.
The package enables outer shadow, inner shadow, border and inner gradient styles for Flutter’s standard controls. These can be applied without using external control widgets.
Usage
You can customize all your controls at once via the theme setting of MaterialApp, or separate controls through changing their own styles.
To use the plugin with inputs, you need to wrap InputBorder with DecoratedInputBorder and configure its parameters.
Add the borderGradient or GradientBorderSide parameter to DecoratedInputBorder or DecoratedOutlinedBorder. This parameters differ from the Flutter’ BorderSide in that they use gradient parameter instead of color.
The wrappers DecoratedInputBorder and DecoratedOutlinedBorder reach an element’s border through the child parameter and apply stylization above the default border of this element. In case of an outer shadow, the shadow’s part above the control then gets cut off in order to create an illusion of the shadow being located behind the control.
Decorative styles are applied above the layer that contains an element’s border. Hence, when it comes to buttons, such stylisation overlaps the inner area of an element. Using transparent colours hence used to address this issue. This limitation is due to Flutter itself.
Compatibility
The following borders have been tested.
Inputs:
UnderlineInputBorder
OutlineInputBorder
Buttons:
BeveledRectangleBorder
CircleBorder
ContinuousRectangleBorder
RoundedRectangleBorder
StadiumBorder
Issues
Shadows may overlap nearby elements.
The decoration of the inner area of the button overlaps the button itself.