Erstellen Sie einfach responsive Flutter-Apps. Passen Sie die Benutzeroberfläche automatisch an verschiedene Bildschirmgrößen an. Responsive gestaltet einfach.
Aus öffentlichen Paketdaten erstellte Orientierung.
Responsive_Framework ist ein Flutter-Paket, das die Erstellung von responsive Benutzeroberflächen auf verschiedenen Bildschirmgrößen und Plattformen vereinfacht. Es bietet intuitive Werkzeuge, um Layouts, Schriftarten und Abstände automatisch an die Geräteabmessungen anzupassen. Mit eingebauten Breakpoints und flexiblen Designmustern können Entwickler konsistente UIs für Android, iOS, Web, macOS, Windows und Linux erstellen, ohne komplexe Media Queries schreiben zu müssen. Das Paket lässt sich nahtlos in bestehende Projekte integrieren und verbessert die Cross-Platform-Kompatibilität.
Anwendungsfälle
Erstellen von plattformübergreifenden Apps mit konsistenten Layouts
Anpassen von Benutzeroberflächen für verschiedene Bildschirmgrößen
Skalierbare Designs für Mobile und Web erstellen
Responsive Typografie vereinfachen
Entwicklung anpassungsfähiger Gittersysteme
Die Konsistenz der Benutzeroberfläche über Geräte hinweg sicherstellen
Hauptmerkmale
Automatische Layoutanpassung
Eingebaute responsive Breakpoints
Plattformübergreifende Unterstützung
Einfache Integration mit bestehendem Code
Flexible Größen- und Abstandskontrollen
Unterstützung für alle wichtigen Flutter-Plattformen
Geeignet für
Flutter-Entwickler, die responsive Benutzeroberflächen suchen
Teams, die Multiplattform-Anwendungen entwickeln
Projekte, die dynamische Layoutanpassungen erfordern
Entwickler, die Boilerplate-Code reduzieren möchten
Apps für unterschiedliche Bildschirmgrößen
Hinweise
Kann für neue Benutzer eine anfängliche Lernkurve erfordern
Abhängig von der korrekten Konfiguration von Breakpoints
Am besten geeignet für Apps mit vorhersehbaren Layout-Anforderungen
Eingeschränkte Anpassungsmöglichkeiten für sehr komplexe Layouts
Nicht ideal für statische, nicht reaktive Designs
Original-README
Originaler README-Schnappschuss aus dem verknüpften Quell-Repository. Aktuelle Inhalte finden Sie im Repository.
Responsive Framework
Responsiveness made simple
The Responsive Framework includes widgets that help developers build responsive apps for mobile, desktop, and website layouts.
Use the labels you defined for layouts and values.
// Example: if the screen is bigger than the Mobile breakpoint, build full width AppBar icons and labels.if (ResponsiveBreakpoints.of(context).largerThan(MOBILE))
FullWidthAppBarItems()
// BooleansResponsiveBreakpoints.of(context).isDesktop;
ResponsiveBreakpoints.of(context).isTablet;
ResponsiveBreakpoints.of(context).isMobile;
ResponsiveBreakpoints.of(context).isPhone;
// ConditionalsResponsiveBreakpoints.of(context).equals(DESKTOP)
ResponsiveBreakpoints.of(context).largerThan(MOBILE)
ResponsiveBreakpoints.of(context).smallerThan(TABLET)
ResponsiveBreakpoints.of(context).between(MOBILE, TABLET)
...
Customization
You can define your own breakpoint labels and use them in your conditionals.
For example, if you're building a Material 3 Navigation Rail and want to expand the menu to full width once there is enough room, you can add a custom EXPAND_SIDE_PANEL breakpoint.
The ResponsiveFramework includes a few custom widgets that supplement Flutter's responsive capabilities. Their usages are showcased in the demo projects.
The remainder of the legacy ReadMe is preserved below as the concepts are still useful and used by the new widgets. ResponsiveWrapper has been deprecated and removed.
The Problem
Supporting multiple display sizes often means recreating the same layout multiple times. Under the traditional Bootstrap approach, building responsive UI is time consuming, frustrating and repetitive. Furthermore, getting everything pixel perfect is near impossible and simple edits take hours.
The Solution
Use Responsive Framework to automatically scale your UI.
ResponsiveBreakpoint.autoScale(600);
AutoScale
AutoScale shrinks and expands your layout proportionally, preserving the exact look of your UI.
This eliminates the need to manually adapt layouts to mobile, tablet, and desktop.
ResponsiveBreakpoint.autoScale(600);
Flutter's default behavior is resize which Responsive Framework respects. AutoScale is off by default and can be enabled at breakpoints by setting autoScale to true.
Breakpoints
Breakpoints control responsive behavior at different screen sizes.
Breakpoints give you fine-grained control over how your UI displays.
Introductory Concepts
These concepts helps you start using the Responsive Framework and build an responsive app quickly.
Scale vs Resize
Flutter's default behavior is to resize your layout when the screen dimensions change. Resizing a layout stretches it in the direction of an unconstrained width or height. Any constrained dimension stays fixed which is why mobile app UIs look tiny on desktop. The following example illustrates the difference between resizing and scaling.
An AppBar widget looks correct on a phone. When viewed on a desktop however, the AppBar is too short and the title looks too small.
Here is what happens under each behavior:
Resizing (default) - the AppBar's width is double.infinity so it stretches to fill the available width. The Toolbar height is fixed and stays 56dp.
Scaling - the AppBar's width stretches to fill the available width. The height scales proportionally using an aspect ratio automatically calculated from the nearest ResponsiveBreakpoint. As the width increases, the height increases proportionally.
When scaled, the AppBar looks correct on desktop, up to a certain size. Once the screen becomes too wide, the AppBar starts to appear too large. This is where breakpoints come in.
Breakpoint Configuration
To adapt to a wide variety of screen sizes, set breakpoints to control responsive behavior.
No project wiki exists yet unfortunately. That means this is an opportunity for you to create and maintain the wiki for one of the most popular Flutter packages. This package needs your help with documentation!
Please reach out via the contact links below if you are interested.
About
Responsive Framework was created out of a desire for a better way to manage responsiveness. The ability to automatically adapt UI to different sizes opens up a world of possibilities. Here at Codelessly, we're building a Flutter app UI and website builder, development tools, and UI templates to increase productivity. If that sounds interesting, you'll want to subscribe to updates below 😎
Responsive Framework is licensed under Zero-Clause BSD and released as Emailware. If you like this project or it helped you, please subscribe to updates. Although it is not required, you might miss the goodies we share!
Badges 🏆
Now you can proudly display the time and headache saved by using Responsive Framework with a supporter's badge.
<ahref="https://github.com/Codelessly/ResponsiveFramework"><imgalt="Built with Responsive Framework"src="https://raw.githubusercontent.com/Codelessly/ResponsiveFramework/master/packages/Built%20with%20Responsive%20Badge.png"/></a>
Flutter is a game-changing technology that will revolutionize not just development, but software itself. A big thank you to the Flutter team for building such an amazing platform 💙