ready_made_extensions 0.0.4
ready_made_extensions: ^0.0.4 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, list operations, DateTime formatting, widget spacing, and more!
π Features #
- Extensions for String, List, DateTime, BuildContext, and Widgets.
- Reduce boilerplate code in your Flutter apps.
- Boost readability and maintainability.
- Fully supports null-safety.
π¦ Installation #
Add this to your packageβs pubspec.yaml file:
dependencies:
ready_made_extensions: ^0.0.4
Then run:
bash
Copy code
flutter pub get
If you are testing locally:
yaml
Copy code
dependencies:
ready_made_extensions:
path: ../ready_made_extensions
β‘ 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.
isEmail β Checks if string is a valid email.
isPhone β Checks if string is a valid phone number.
reversed β Reverses the string.
camelCase β Converts to camelCase.
snakeCase β Converts to snake_case.
πΉ List
unique() β Removes duplicates.
chunked(size) β Splits list into chunks.
sum β Calculates sum of numbers.
average β Finds average of numbers.
πΉ DateTime
timeAgo β Formats as β5m agoβ, β2h agoβ, etc.
startOfDay / endOfDay
isToday
πΉ BuildContext
screenHeight / screenWidth
isDarkMode
textTheme / colors
πΉ Widget
.paddingAll(value)
.paddingSym(h: x, v: y)
.center
.expanded
.onTap(callback)
β¦and many more π
π οΈ Contributing
Contributions are welcome!
Open an issue
Submit a pull request
Suggest new extensions
π License
This project is licensed under the MIT License.
β€οΈ Support
If you like this package, donβt forget to:
β Star the repo on GitHub
Share with your friends & Flutter devs!