dev_utils 0.0.3 dev_utils: ^0.0.3 copied to clipboard
Utils to make developement faster.
π Flutter Utils π #
Welcome to Flutter Utils, your new best friend for Flutter development! π¨
This utility package brings convenience, efficiency, and simplicity to your Flutter apps. With a wide variety of extensions, validators, and utilities, weβve made it easier to build beautiful, responsive, and maintainable Flutter apps with less boilerplate code! π§βπ»β¨
Features π #
π οΈ Extensions for BuildContext
#
Say goodbye to repetitive code! Our extensions on BuildContext
give you instant access to useful properties like:
- π± MediaQuery β Screen size, orientation, and device pixel ratio.
- π¨ ThemeData β Colors, typography, and more.
- π» Breakpoints β Responsive layout detection (
isMobile
,isTablet
,isDesktop
). - π Navigation β Push and pop routes easily.
𧩠Widget Padding Extensions #
Add padding to any widget effortlessly:
- Uniform padding with
pad()
. - Symmetric padding with
paddingSymmetric()
. - Custom padding for top, bottom, left, right with
customPadding()
.
π Validators #
No more manual validation! π₯ Validate:
- π§ Emails β Check for valid email addresses.
- π Passwords β Ensure passwords are strong enough.
- π± Phone Numbers β Validate phone number formats.
- π And many more! Quickly add these checks to your forms.
π± Additional Utilities #
- Adaptive Padding: Adjust padding based on the screen width π.
- Dynamic Font Scaling: Make text responsive to screen size! π€.
- Safe Area Helpers: Easy access to safe area padding & view insets π±.
π How It Helps Developers #
πͺ Less Boilerplate #
Stop repeating yourself! Flutter Utils simplifies common tasks with clean and easy-to-use extensions, saving you time and effort. π
π± Responsive Design Made Easy #
Detect screen sizes and orientations with ease. Whether youβre building for mobile, tablet, or desktop, Flutter Utils has you covered. π₯οΈπ±
π Validate User Input Like a Pro #
Forget writing manual validation logic. With just a call, you can validate email, phone numbers, and passwords. Let Flutter Utils handle the validation while you focus on building cool features. π
π¨ Theming and Styling at Your Fingertips #
Quickly access theme properties, text styles, and colors without digging into Theme.of(context)
. Just use the simple extensions to make your UI consistent and stylish! π
π¦ Installation #
Add the package to your pubspec.yaml
:
dependencies:
flutter_utils: latest_version
Run flutter pub get
to install π.
π Usage #
π οΈ Context Extensions #
Access media queries, themes, and breakpoints with ease:
import 'package:flutter_utils/flutter_utils.dart';
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: context.primaryColor, // π¨ Access theme colors!
width: context.width * 0.8, // π Use 80% of screen width
height: context.height * 0.5,
child: Text(
'Hello, Flutter!',
style: context.textTheme.headlineMedium, // ποΈ Apply text styles
),
);
}
}
𧩠Widget Padding Extensions #
Add padding in a breeze:
import 'package:flutter_utils/flutter_utils.dart';
Text('Padded Text').uniformPadding(16); // πͺ Add uniform padding of 16
Text('Custom Padding').customPadding(left: 10, top: 5); // π― Add custom padding
π Validators #
Validate common input fields:
import 'package:flutter_utils/flutter_utils.dart';
String email = 'test@example.com';
if (!email.isValidEmail()) {
print('Invalid email address! π§');
}
String password = 'P@ssw0rd';
if (!password.isStrongPassword()) {
print('Weak password! π');
}
π± Breakpoints #
Create responsive layouts based on screen size:
import 'package:flutter_utils/flutter_utils.dart';
if (context.isMobile) {
print('Mobile layout detected! π±');
} else if (context.isTablet) {
print('Tablet layout detected! π»');
}
π Documentation #
Check out the API docs for a complete list of available extensions and methods. With Flutter Utils, you have everything you need to streamline your development process and create beautiful, responsive apps faster than ever! π
π€ Contributing #
We welcome contributions! Feel free to fork the repo, create a pull request, or report any issues you find. Letβs make this package even better, together! π
π§βπ» License #
This package is distributed under the MIT License. See LICENSE for details. β¨
Let me know if you'd like to add any other specific sections or features, and I can enhance the README
further!