सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
Responsive_Framework एक Flutter पैकेज है जो विभिन्न स्क्रीन आकारों और प्लेटफॉर्मों पर प्रतिक्रियाशील उपयोगकर्ता इंटरफ़ेस बनाने को सरल बनाता है। यह डिवाइस आयामों के आधार पर लेआउट, फ़ॉन्ट और स्पेसिंग को स्वचालित रूप से अनुकूलित करने के लिए सुविधाजनक उपकरण प्रदान करता है। निर्मित ब्रेकपॉइंट्स और लचीले डिज़ाइन पैटर्न के साथ, डेवलपर्स को कॉम्प्लेक्स मीडिया क्वेरी लिखे बिना Android, iOS, Web, macOS, Windows और Linux के लिए सुसंगत UI बनाने में सक्षम बनाया जाता है। पैकेज मौजूदा प्रोजेक्ट में बिना किसी दिक्कत के एकीकृत होता है और क्रॉस-प्लेटफॉर्म संगतता को बढ़ाता है।
उपयोग
समान लेआउट के साथ क्रॉस-प्लेटफॉर्म एप्लिकेशन बनाना
विभिन्न स्क्रीन आकारों के लिए UI का अनुकूलन
मोबाइल और वेब के लिए स्केलेबल डिज़ाइन बनाना
प्रतिक्रियाशील टाइपोग्राफी को सरल बनाना
अनुकूल ग्रिड प्रणाली का डिज़ाइन करना
उपकरणों के बीच UI सुसंगतता सुनिश्चित करना
मुख्य विशेषताएँ
स्वचालित लेआउट अनुकूलन
एम्बेडेड रिस्पॉन्सिव ब्रेकपॉइंट्स
क्रॉस-प्लेटफ़ॉर्म समर्थन
मौजूदा कोड के साथ आसान एकीकरण
लचीले आकार और स्पेसिंग नियंत्रण
सभी प्रमुख Flutter प्लेटफॉर्म के लिए समर्थन
इनके लिए उपयुक्त
प्रतिक्रियाशील उपयोगकर्ता इंटरफेस की तलाश में फ्लटर विकासकर्मी
बहु-प्लेटफॉर्म एप्लिकेशन बनाने वाली टीमें
गतिशील लेआउट समायोजन की आवश्यकता वाले प्रोजेक्ट
बॉयलरप्लेट कोड कम करना चाहते हैं विकासकर्ता
विविध स्क्रीन आकारों के लिए लक्षित ऐप्स
विचार योग्य बातें
नए उपयोगकर्ताओं के लिए प्रारंभिक सीखने का वक्र आवश्यक हो सकता है
ब्रेकपॉइंट के सही विन्यास पर निर्भर करता है
पूर्वानुमानित लेआउट की आवश्यकता वाले एप्लिकेशन के लिए सबसे उपयुक्त
अत्यधिक जटिल लेआउट के लिए सीमित कस्टमाइज़ेशन
स्थिर, अन-प्रतिक्रियाशील डिज़ाइन के लिए आदर्श नहीं
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
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 💙