ready_made_extensions 0.0.2
ready_made_extensions: ^0.0.2 copied to clipboard
A collection of ready-made Dart & Flutter extensions to simplify code, improve readability, and boost reusability.
ready_made_extensions π #
A Flutter/Dart package that provides ready-made extensions to make your code cleaner, shorter, and easier to read.
With ready_made_extensions, you can simplify common tasks like string manipulation, widget spacing, and more!
π Features #
- Handy extensions for String, int, double, DateTime, and more.
- Flutter-specific extensions for widgets (e.g., adding padding, margin, etc.).
- Write less code and achieve more readability.
- 100% null-safety.
π¦ Installation #
Add this to your packageβs pubspec.yaml file:
dependencies:
ready_made_extensions: ^0.0.2
Or if you are testing locally:
yaml
Copy code
dependencies:
ready_made_extensions:
path: ../ready_made_extensions
Then run:
bash
Copy code
flutter pub get
β‘ Usage
Import the package:
dart
Copy code
import 'package:ready_made_extensions/ready_made_extensions.dart';
Example
dart
Copy code
import 'package:flutter/material.dart';
import 'package:ready_made_extensions/ready_made_extensions.dart';
class TestScreen extends StatelessWidget {
const TestScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: "hello world"
.capitalize() // from ready_made_extensions
.text() // converts to Text widget
.paddingAll(16), // adds padding
),
);
}
}
π Available Extensions
String
capitalize() β Capitalizes first letter.
isValidEmail() β Checks if string is a valid email.
reverse() β Reverses the string.
int
toCurrency() β Converts int to formatted currency.
seconds / minutes β Converts to Duration.
double
toPrecision(n) β Rounds to n decimal places.
Widget
.paddingAll(value) β Adds padding.
.marginAll(value) β Adds margin.
.onTap(callback) β Wraps widget with GestureDetector.
.center() β Wraps in Center widget.
β¦and many more π
π οΈ Contributing
Contributions are welcome!
Feel free to open an issue or submit a pull request on GitHub.
π License
This project is licensed under the MIT License.
β€οΈ Support
If you like this package, donβt forget to star the repo β on GitHub and share with others.