🚀 EaseX - Simplify Flutter Development đŸ—ī¸

EaseX is a feature-rich Flutter package that enhances development by providing a collection of powerful extensions and utilities. It simplifies UI styling, navigation, validation, device information handling, and much more. ✨


EaseX Animation

đŸŽ¯ Features

✅ Text Styling Extensions đŸ–Œī¸ - Easily apply bold, italic, underlined, colored, and size styles to Text widgets.

✅ Navigation Simplifications 🧭 - Use .push() and .pop() to navigate between screens effortlessly.

✅ Device Utilities 📱 - Get device information like screen size, platform type (Android/iOS), and keyboard visibility.

✅ Enhanced Validation Helpers ✅ - Built-in validators for email, phone, password, credit card, URL, age, username, postal codes, and more with advanced options.

✅ Toast Notifications 🔔 - Display toast messages easily using showToast(), showSuccessToast(), etc.

✅ Spacing & Padding Extensions 📏 - Use .vBox and .pad() to manage spacing between widgets.

✅ Keyboard Management âŒ¨ī¸ - Hide the keyboard programmatically with EaseXDevice.hideKeyboard().

✅ Rotation & Visibility 🔄 - Rotate widgets with .rotate() and conditionally show them with .showIf().

✅ Asynchronous Handling âŗ - Delay actions using Future.delayed(1.seconds) instead of manually defining durations.

✅ Loading Indicator 🔃 - Show and hide a global loader using EaseXLoader.show() and EaseXLoader.hide().

✅ Expandable Widgets 📐 - Wrap widgets in .expanded() for better layout management.

✅ Smooth Alert Dialog Animation 🎭 - Animated alert dialogs with bounce effects!

✅ Sharing Made Easy with EaseXShare Utils 🎭 - Share text, images, videos, pdf and etc... files easily using EaseXShare Utils.

✅ EaseXMedia - Powerful media picking utilities

✅ EaseXStorage - Simple key-value storage

✅ đŸŽŦ Animation Extensions - Add beautiful animations to widgets with .fadeIn(), .slideIn(), .bounce(), .shake(), and more!

✅ 🎨 Color Utilities - Comprehensive color manipulation tools including hex conversion, color blending, material palette generation, and social media brand colors.

✅ 💾 Cache Utilities - Smart caching system with TTL support, file caching, and cache management.

✅ 🔐 Permission Utilities - Easy permission handling for camera, storage, location, contacts, and more with user-friendly dialogs.

🆕 New Features in v2.0.0

đŸŽŦ Animation Extensions

// Fade in animation
Text('Hello').fadeIn(duration: 300.ms)

// Slide animations
Container().slideInFromBottom()
Container().slideInFromTop()
Container().slideInFromLeft()
Container().slideInFromRight()

// Scale and rotation
Icon(Icons.star).scaleIn()
Image.asset('logo.png').rotateIn()

// Special effects
Button('Click me').bounce()
Text('Error').shake()

🎨 Color Utilities

// Color conversion
Color color = EaseXColors.fromHex('#FF5722');
String hex = EaseXColors.toHex(Colors.blue);

// Color manipulation
Color darker = Colors.blue.darken(0.2);
Color lighter = Colors.red.lighten(0.3);

// Random colors
Color randomColor = EaseXColors.random();
Color pastelColor = EaseXColors.randomPastel();

// Material palette
Map<String, Color> palette = EaseXColors.generateMaterialPalette(Colors.purple);

// Social media colors
Container(color: EaseXColors.facebook)
Container(color: EaseXColors.twitter)

💾 Cache Utilities

// Initialize cache
await EaseXCache.init();

// Cache data with TTL
await EaseXCache.cacheData('user_token', 'abc123', ttl: 1.hours);

// Get cached data
String? token = EaseXCache.getCachedData<String>('user_token');

// Cache files
await EaseXCache.cacheFile('profile_image', imageFile);
String? cachedPath = EaseXCache.getCachedFilePath('profile_image');

// Cache management
await EaseXCache.clearExpiredCache();
int size = await EaseXCache.getCacheSize();

🔐 Permission Utilities

// Request single permission
bool hasCamera = await EaseXPermissions.requestCameraPermission();

// Request with rationale dialog
bool hasLocation = await EaseXPermissions.handlePermissionRequest(
  context,
  Permission.location,
  title: 'Location Needed',
  rationaleMessage: 'We need location to show nearby places',
);

// Check permission status
bool isGranted = await EaseXPermissions.isPermissionGranted(Permission.camera);

// Request multiple permissions
final results = await EaseXPermissions.requestMultiplePermissions([
  Permission.camera,
  Permission.microphone,
  Permission.storage,
]);

🆕 Previous Features in v1.6.x

✅ EaseFileSaver - Save Dynamic Files in iOS and Android

✅ Shimmer Effect on Widgets – Easily apply a shimmer effect to any widget using .shimmer()

And much more! 🚀 Explore the complete package to discover all utilities. đŸ“Ļ


🚀 Getting Started

đŸ“Ĩ Install the package

flutter pub add ease_x

📌 Import it into your project

import 'package:ease_x/ease_x.dart';

🔧 Setup Instructions (Important!)

âš ī¸ Permission Utilities Setup (Only if you use them)

Good news: If you don't use the permission utilities (EaseXPermissions), you don't need to do any additional setup! The package works out of the box for all other features.

If you use permission utilities, you need to add platform-specific configurations:

iOS Setup - ios/Runner/Info.plist

Add these usage descriptions based on which permissions you need:

<key>NSCameraUsageDescription</key>
<string>This app needs camera access to take photos</string>

<key>NSPhotoLibraryUsageDescription</key>
<string>This app needs photos access to select images</string>

<key>NSLocationWhenInUseUsageDescription</key>
<string>This app needs location access to show nearby places</string>

<key>NSMicrophoneUsageDescription</key>
<string>This app needs microphone access for recording</string>

<key>NSContactsUsageDescription</key>
<string>This app needs contacts access to find friends</string>

Android Setup - android/app/src/main/AndroidManifest.xml

Add required permissions based on your needs:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_CONTACTS" />

Note: Only add the permissions you actually use in your app!


⚡ Usage

🎨 Text Styling Extensions

Text('Bold Text').bold(); // 🔠 Make text bold
Text('Colored Text').colored(Colors.deepPurple); // 🎨 Apply color to text
Text('Sized Text').size(20); // 🔡 Change text size
Text('Underlined Text').underlined(); // âœī¸ Underline text

🧭 Navigation Simplification

context.push(SecondScreen()); // 🚀 Navigate to another screen
context.pop(); // 🔙 Go back to the previous screen

📱 Device Utilities

bool hasInternet = await EaseXDevice.hasInternetConnection(); // 🌍 Check internet connection
double screenWidth = EaseXDevice.getScreenWidth(context); // 📏 Get screen width

🎨 Light and Dark Theme

MaterialApp(
  debugShowCheckedModeBanner: false,
  theme: EaseXTheme.light, // 🌞 Light Theme
  darkTheme: EaseXTheme.dark, // 🌙 Dark Theme
  navigatorKey: EaseXLoader.navigatorKey, // 🔄 Required for EaseXLoader
  home: const ExampleHomeScreen(), // 🏠 Initial Screen
);

🔔 Toast Messages

"Hello from EaseX!".showBlackToast(); // đŸ“ĸ Show black toast
"Success!".showSuccessToast(); // ✅ Show success toast

âŗ Show/Hide Loader

EaseXLoader.show(); // 🔄 Show loading indicator
await Future.delayed(2.seconds);
EaseXLoader.hide(); // ❌ Hide loader

🎭 Animated Alert Dialogs**

EaseXLoader.showAlert("This is an info alert!"); // â„šī¸ Show an info alert
EaseXLoader.showErrorAlert("Oops! Something went wrong."); // ❌ Show an error alert
EaseXLoader.showSuccessAlert(); // ✅ Show a success alert

🔗 Share Utils

EaseXShare.shareSingleImage(imageFile, text: "Sample Text");
EaseXShare.shareFile(file);
EaseXShare.openWhatsAppChat('+91', '8920119443',message: "Flutter Developer.");

đŸ‘ī¸ Conditional Visibility

Text('Visible Text').showIf(condition == true); // 👀 Show text based on condition

đŸ–ŧī¸ Media Utilities

// Pick single image
final image = await EaseXMedia.pickImage();
// Pick video
final video = await EaseXMedia.pickVideo();

💾 EaseX Storage

// Initialize (call once)
await EaseXStorage.init();

// Save data
await EaseXStorage.setString('token', 'abc123');

// Read data
final token = EaseXStorage.getString('token');

// Remove data
// await EaseXStorage.remove('token');

🆕 New Features in v1.5.0

💾 EaseX File Saver

await EaseXFileSaver.saveFile(
fileName: 'note',
type: FileType.text,
content:
'EaseX is an Utility package for helping Flutter Developers.',
);

✨ Shimmer Effect

Container(
width: 200,
height: 120,
decoration:
BoxDecoration(borderRadius: BorderRadius.circular(12.0)),
).shimmer().pad(all: 12.0)

đŸŽŦ Animation Extensions

// Fade in with delay
Text('Animated Text').fadeIn(
  duration: 500.ms,
  delay: 200.ms,
);

// Slide from different directions
Container().slideInFromBottom(offset: 50.0);
Icon(Icons.star).slideInFromLeft();

// Scale and bounce effects
Image.network('url').scaleIn(beginScale: 0.5);
Button('Click me').bounce();

// Shake effect for errors
Text('Invalid input').shake();

🎨 Color Utilities

// Convert between formats
Color fromHex = EaseXColors.fromHex('#FF5722');
String toHex = Colors.blue.toHex();

// Color manipulation
Color darker = Colors.blue.darken(0.2);
Color lighter = Colors.red.lighten(0.3);
Color complementary = Colors.green.complementary;

// Generate colors
Color random = EaseXColors.random(bright: true);
Color pastel = EaseXColors.randomPastel();

// Material design palette
final palette = EaseXColors.generateMaterialPalette(Colors.purple);
final purple50 = palette['50'];
final purple900 = palette['900'];

// Social media brand colors
Container(color: EaseXColors.facebook)
Container(color: EaseXColors.instagram)
Container(color: EaseXColors.twitter)

💾 Cache Utilities

// Initialize cache system
await EaseXCache.init();

// Cache data with TTL
await EaseXCache.cacheData('api_response', responseData, ttl: 30.minutes);
await EaseXCache.cacheList('user_list', users, ttl: 1.hours);

// Retrieve cached data
final response = EaseXCache.getCachedData<Map<String, dynamic>>('api_response');
final users = EaseXCache.getCachedList<User>('user_list');

// File caching
await EaseXCache.cacheImageFromUrl('https://example.com/image.jpg', 'profile_image');
final cachedImage = EaseXCache.getCachedImage('profile_image');

// Cache management
await EaseXCache.clearExpiredCache();
await EaseXCache.clearAllCache();

// Cache statistics
final stats = await EaseXCache.getCacheStats();
print('Cache size: ${stats['cacheSize']}');
print('Valid entries: ${stats['validEntries']}');

🔐 Permission Utilities

// Request individual permissions
bool cameraGranted = await EaseXPermissions.requestCameraPermission();
bool locationGranted = await EaseXPermissions.requestLocationPermission();
bool storageGranted = await EaseXPermissions.requestStoragePermission();

// Request with user-friendly dialogs
bool granted = await EaseXPermissions.handlePermissionRequest(
  context,
  Permission.camera,
  title: 'Camera Permission Required',
  rationaleMessage: 'We need camera access to take photos',
  deniedMessage: 'Camera permission was denied',
  permanentlyDeniedMessage: 'Please enable camera in settings',
);

// Check permission status
bool isGranted = await EaseXPermissions.isPermissionGranted(Permission.camera);
bool isDenied = await EaseXPermissions.isPermissionDenied(Permission.camera);
bool isPermanentlyDenied = await EaseXPermissions.isPermissionPermanentlyDenied(Permission.camera);

// Request multiple permissions
final results = await EaseXPermissions.requestMultiplePermissions([
  Permission.camera,
  Permission.microphone,
  Permission.location,
]);

// Get all permissions status
final statusMap = await EaseXPermissions.getAllPermissionsStatus();

// Handle missing permissions
final required = [Permission.camera, Permission.storage];
final missing = await EaseXPermissions.getMissingPermissions(required);
if (missing.isNotEmpty) {
  await EaseXPermissions.requestMissingPermissions(required);
}

🔧 Enhanced Form Validation

Basic Validation

// Required field validation
String? error = EaseXValidator.validateEmptyText('Name', value);

// Email validation
String? emailError = EaseXValidator.validateEmail('user@example.com');

// Enhanced password validation
String? passwordError = EaseXValidator.validatePassword(
  'P@ssw0rd123',
  minLength: 8,
  requireUppercase: true,
  requireLowercase: true,
  requireNumbers: true,
  requireSpecialChars: true,
);

// Phone number validation (country-specific)
String? phoneError = EaseXValidator.validatePhoneNumber(
  '+1234567890',
  countryCode: 'US',
  allowInternational: true,
);

Advanced Validation

// URL validation
String? urlError = EaseXValidator.validateURL('https://example.com');

// Credit card validation with Luhn algorithm
String? cardError = EaseXValidator.validateCreditCard('4111 1111 1111 1111');

// Expiry date validation
String? expiryError = EaseXValidator.validateExpiryDate('12/25');

// CVV validation
String? cvvError = EaseXValidator.validateCVV('123');

// Age validation
String? ageError = EaseXValidator.validateAge(25, min: 18, max: 100);

// Username validation
String? usernameError = EaseXValidator.validateUsername(
  'john_doe123',
  minLength: 3,
  maxLength: 20,
);

// Name validation
String? nameError = EaseXValidator.validateName('John Doe', fieldName: 'First Name');

// Postal code validation (country-specific)
String? postalError = EaseXValidator.validatePostalCode(
  'SW1A 1AA',
  countryCode: 'UK',
);

// Number validation with range
String? numberError = EaseXValidator.validateNumber(
  '42',
  min: 1,
  max: 100,
  allowDecimals: false,
);

🚀 Future Roadmap (Coming Soon)

Enhanced Device Information

  • Device ID and unique identifiers
  • App version information
  • Battery level monitoring
  • Device memory and storage info
  • Network connectivity details
  • Screen density and DPI information

File System Utilities

  • File size calculation and formatting
  • Directory size analysis
  • Cache cleanup automation
  • File type detection
  • Secure file operations

Localization Support

  • Currency formatting for different locales
  • Number and date localization
  • Text direction (RTL/LTR) support
  • Locale-aware validation
  • Multi-language error messages

Security Utilities

  • Password hashing and encryption
  • Secure token generation
  • Biometric authentication helpers
  • Data obfuscation utilities
  • Security best practices helpers

â„šī¸ Additional Information

EaseX is designed to make Flutter development easier and faster by reducing boilerplate code and providing comprehensive utilities for common development tasks. 🚀

The package now includes animation extensions, color utilities, enhanced validation, caching system, and permission management to handle all your development needs in one place.

There is so much more to explore! Check out the package code for a deep dive into all available features.

Happy coding! 🎉đŸ”Ĩ


👨‍đŸ’ģ Contributors

This package is actively maintained by:


Shashwat

Ajay

đŸ“Ŧ Feel free to connect with us on LinkedIn! 🚀


Let me know if you need any modifications! 🚀đŸ”Ĩ