Crie facilmente aplicativos Flutter responsivos. Adapte automaticamente a interface do usuário a diferentes tamanhos de tela. Responsividade simplificada.
Orientação gerada a partir de informações públicas. Apenas para referência.
Responsive_Framework é um pacote Flutter que simplifica a criação de interfaces do usuário responsivas em diferentes tamanhos de tela e plataformas. Ele fornece ferramentas intuitivas para adaptar automaticamente layouts, fontes e espaçamentos com base nas dimensões do dispositivo. Com breakpoints embutidos e padrões de design flexíveis, os desenvolvedores podem criar interfaces consistentes para Android, iOS, Web, macOS, Windows e Linux sem escrever consultas de mídia complexas. O pacote se integra perfeitamente em projetos existentes e melhora a compatibilidade entre plataformas.
Casos de uso
Criando aplicativos multiplataforma com layouts consistentes
Adaptando interfaces para diferentes tamanhos de tela
Criando designs escaláveis para mobile e web
Simplificando tipografia responsiva
Projetando sistemas de grade adaptativos
Garantir a consistência da interface do usuário entre dispositivos
Principais recursos
Adaptação automática de layout
Pontos de quebra responsivos embutidos
Suporte multiplataforma
Integração fácil com código existente
Controles flexíveis de tamanho e espaçamento
Suporte para todas as principais plataformas do Flutter
Indicado para
Desenvolvedores Flutter em busca de interfaces responsivas
Equipes construindo aplicativos multiplataforma
Projetos que exigem ajustes dinâmicos de layout
Desenvolvedores que querem reduzir o código repetitivo
Aplicativos direcionados a tamanhos de tela diversos
Considerações
Pode exigir uma curva de aprendizado inicial para novos usuários
Depende da configuração adequada dos pontos de interrupção
Mais adequado para aplicativos com necessidades de layout previsíveis
Personalização limitada para layouts altamente complexos
Não ideal para designs estáticos e não responsivos
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
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 💙