rifcare_responsive 2.0.0
rifcare_responsive: ^2.0.0 copied to clipboard
A responsive class to handle UI elements across different screen sizes.
README #
rifcare_responsive Library #
Overview #
The rifcare_responsive package is a Flutter library designed to simplify responsive design by providing a widget and utility methods to handle layout changes across different screen sizes.
Installation #
Add the following dependency to your pubspec.yaml file:
dependencies:
rifcare_responsive: latest_version
Then, run the following command to fetch the package:
flutter pub get
Usage #
To use the RifcareResponsive widget, import the package into your Dart file:
import 'package:rifcare_responsive/rifcare_responsive.dart';
Example
import 'package:flutter/material.dart';
import 'package:rifcare_responsive/rifcare_responsive.dart';
class ResponsiveExample extends StatelessWidget {
@override
Widget build(BuildContext context) {
return RifcareResponsive(
builder: (context, constraints) {
if (RifcareResponsive.isMobile(constraints)) {
return MobileLayout();
} else if (RifcareResponsive.isTablet(constraints)) {
return TabletLayout();
} else {
return DesktopLayout();
}
},
);
}
}
API Reference #
RifcareResponsive
builder: A required callback function that takesBuildContextandBoxConstraintsas parameters and returns aWidget.isMobile(BoxConstraints constraints): Returnstrueif the device is classified as a mobile device (width < 600).isTablet(BoxConstraints constraints): Returnstrueif the device is classified as a tablet (600 ≤ width < 1200).isDesktop(BoxConstraints constraints): Returnstrueif the device is classified as a desktop device (width ≥ 1200).
Features #
- Simplifies responsive UI development by detecting device types.
- Flexible layout building with a
buildercallback. - Lightweight and easy to integrate.
Contributing #
Contributions are welcome! Please feel free to submit a pull request or file an issue for bugs or feature requests.
License #
This project is licensed under the MIT License. See the LICENSE file for more details.
Contact #
For any queries or support, reach out to:
- Email: support@rifcare.in
- Company: RIFCARE TECH PVT LIMITED
Thank you for using rifcare_responsive. We look forward to your feedback and suggestions!