Last updated:
0 purchases
ez snapx
ez_snapx #
ez_snapx is a Flutter package that simplifies common development tasks related to padding, time conversion, and various extensions for enhanced functionality. The package provides intuitive shortcut methods and extensions to streamline your Flutter app development.
Features #
Padding Extensions #
p: Creates EdgeInsets with padding on all sides.
hp: Creates EdgeInsets with horizontal padding.
vp: Creates EdgeInsets with vertical padding.
bp: Creates EdgeInsets with padding only at the bottom.
tp: Creates EdgeInsets with padding only at the top.
rp: Creates EdgeInsets with padding only on the right.
lp: Creates EdgeInsets with padding only on the left.
Example:
import 'package:flutter/material.dart';
import 'package:ez_snapx/ez_snapx.dart';
void main() {
runApp(
Container(
padding: 16.p,
child: Text(
'Hello, ez_snapx!',
style: TextStyle(fontSize: 18),
),
),
);
}
copied to clipboard
Size Extensions #
w: Creates SizedBox with a specified width.
h: Creates SizedBox with a specified height.
Example:
import 'package:flutter/material.dart';
import 'package:ez_snapx/ez_snapx.dart';
void main() {
runApp(
Container(
child: Image.network(
'https://example.com/image.jpg',
width: 200.w,
height: 150.h,
),
),
);
}
copied to clipboard
Time Conversion Extensions #
microseconds: Converts an integer to Duration in microseconds.
milliseconds: Converts an integer to Duration in milliseconds.
seconds: Converts an integer to Duration in seconds.
minutes: Converts an integer to Duration in minutes.
hours: Converts an integer to Duration in hours.
days: Converts an integer to Duration in days.
Example:
import 'package:ez_snapx/ez_snapx.dart';
void main() {
final duration = 30.seconds;
print('Duration in seconds: $duration');
}
copied to clipboard
Lorem Ipsum Generator #
generateLoremIpsum: Generates Lorem Ipsum text based on the specified count.
Example:
import 'package:ez_snapx/ez_snapx.dart';
void main() {
final loremIpsum = 2.generateLoremIpsum();
print(loremIpsum);
}
copied to clipboard
Time Formatting #
convertToReadableTime: Converts an integer representing minutes into a human-readable time format.
Example:
import 'package:ez_snapx/ez_snapx.dart';
void main() {
final time = 90.convertToReadableTime();
print('Readable time: $time');
}
copied to clipboard
DateTime Extensions #
timeAgo: Provides a human-readable representation of the time elapsed since a given DateTime.
Example:
import 'package:ez_snapx/ez_snapx.dart';
void main() {
final dateTime = DateTime.now().subtract(Duration(hours: 2));
final timeAgo = dateTime.timeAgo();
print('Time ago: $timeAgo');
}
copied to clipboard
Indian Number Formatting #
formatIndianNumber: Formats a string representing an Indian-style number with commas.
parseIndianNumber: Parses a string representing an Indian-style number into an integer.
Example:
import 'package:ez_snapx/ez_snapx.dart';
void main() {
final formattedNumber = '1234567'.formatIndianNumber();
print('Formatted number: $formattedNumber');
}
copied to clipboard
String Manipulations #
toTitleCase: Converts a snake_case string to Title Case.
toUpperCase: Converts a string to snake_case.
Example:
import 'package:ez_snapx/ez_snapx.dart';
void main() {
final titleCaseString = 'hello_world'.toTitleCase;
print('Title case: $titleCaseString');
}
copied to clipboard
Getting Started #
Add the ez_snapx dependency to your pubspec.yaml file:
dependencies:
ez_snapx: ^1.0.0
copied to clipboard
Replace ^1.0.0 with the latest version available.
Run flutter pub get in your terminal to install the package.
Import ez_snapx in your Dart file:
import 'package:ez_snapx/ez_snapx.dart';
copied to clipboard
Start using the provided extensions and methods to enhance your Flutter app development.
Contributions #
Contributions to ez_snapx are welcome! If you have suggestions, improvements, or bug fixes, feel free to open an issue or submit a pull request.
License #
ez_snapx is released under the MIT License.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.