flutter_extend 0.0.6
flutter_extend: ^0.0.6 copied to clipboard
Simple, Efficient Flutter Extensions! Supercharge your Flutter development with a collection of easy-to-use, lightweight, and practical extension methods.
Flutter Extend #
A Flutter package designed to provide developers with a collection of useful extensions for Flutter and Dart. These extensions aim to simplify and speed up development by adding frequently used functionalities that are not available out-of-the-box.
Features #
- π Prebuilt Extension Methods: Simplify common Flutter development tasks with prebuilt extensions for widgets, colors, strings, and more.
- π¨ Custom MaterialColor Generator: Easily create dynamic MaterialColor palettes from any Color.
- π Convenient String Manipulations: Transform and format strings effortlessly.
- π Widget Utilities: Add padding, margins, and styling directly to widgets.
Getting started #
- Add this package to your
pubspec.yamlfile:
dependencies:
flutter_extend: ^0.0.6
- Run the following command to get the package:
flutter pub get
- Import the package in your Dart file:
import 'package:flutter_extend/flutter_extend.dart';
Usage #
Context Extensions #
Screen Width - context.screenWidth
/// Get Current Screen Width
Text("SCREEN WIDTH : ${context.screenWidth}")
Check Dark Mode - context.isDarkMode
/// Change color if is Dark Mode
Container(
width: 100,
height: 100,
color: context.isDarkMode ? Colors.grey : Colors.red,
),
Other handy Context Extension methods include:
context.screenWidth,context.screenHeight,context.isDarkMode,context.theme,context.colorScheme
Visit the context_extensions.dart example for the full API Reference.
String Extensions #
import 'package:flutter_extend/flutter_extend.dart';
void main() {
String text = "hello world";
print(text.capitalize()); // Output: Hello world
}
DateTime Extensions #
import 'package:flutter_extend/flutter_extend.dart';
void main() {
DateTime now = DateTime.now();
print(now.isToday()); // Output: true if today, false otherwise
}
Examples #
Check out the examples directory for complete examples demonstrating the use of this package:
git clone https://github.com/KenStarry/flutter_extend.git
cd flutter_extend/examples
flutter run
Contributing #
We welcome contributions! If you have ideas or improvements, feel free to:
- Fork the repository.
- Create a new branch for your feature/bug fix.
- Submit a pull request.
Read the Contributing Guidelines for more details.
Useful Links #
License #
This package is distributed under the MIT License. See the LICENSE file for more details.
See yah!