mplix 0.0.8 copy "mplix: ^0.0.8" to clipboard
mplix: ^0.0.8 copied to clipboard

A collection of useful Flutter and Dart extensions to simplify common tasks.

๐Ÿงฉ Mplix #

Mplix Banner

Mplix is a handy Flutter extension package that enhances your Flutter development experience with powerful, readable, and reusable extensions for String, DateTime, BuildContext, Color, Iterable, Widget, and more โ€” including emoji replacement and utility methods.

๐Ÿš€ Make your Flutter code cleaner, shorter, and more expressive!


โœจ Features #

  • โœ… String extensions โ€“ capitalize, title case, convert to number, sentence case, emoji replacements
  • โœ… DateTime and Duration extensions โ€“ formatted output, comparison helpers
  • โœ… BuildContext extensions โ€“ screen metrics, theme, snackbar, dialog, navigation, clipboard
  • โœ… Widget extensions โ€“ tap handling, padding, spacing
  • โœ… Color extension โ€“ convert to HEX
  • โœ… Iterable extensions โ€“ mapIndexed
  • โœ… Emoji support โ€“ :pizza: โ†’ ๐Ÿ•, :india: โ†’ ๐Ÿ‡ฎ๐Ÿ‡ณ, and more!
  • โœ… Utility โ€“ log() for debug printing with optional tags

๐Ÿš€ Getting Started #

  1. Add this to your pubspec.yaml:
dependencies:
  mplix: ^1.0.0

๐Ÿ“ฆ Usage #

๐Ÿ“ String Extensions #

'flutter dev'.capitalize();                          // Flutter dev
'flutter is cool'.toTitleCase();                     // Flutter Is Cool
'hello world. this is flutter.'.capitalizeSentences(); // Hello world. This is flutter.
'123'.toInt();                                       // 123
'12.34'.toDouble();                                  // 12.34
'Flutter โค๏ธ :pizza: from :india:'.withEmojis();      // Flutter โค๏ธ ๐Ÿ• from ๐Ÿ‡ฎ๐Ÿ‡ณ\
Clean and smart formatting for numbers using intuitive extension methods:

42.toCleanString();          // "42"
42.5.toCleanString();        // "42.50"

1000.toCompact();            // "1K"
1500000.toCompact();         // "1.5M"

1000.toCurrency();           // โ‚น1,000.00 (default locale: en_IN)
1000.toCurrency(symbol: '\$'); // $1,000.00

1234567.toLocalized();       // "12,34,567" (Indian style by default)

1.toOrdinal();               // "1st"
2.toOrdinal();               // "2nd"
3.toOrdinal();               // "3rd"
11.toOrdinal();              // "11th"

๐Ÿ“† DateTime Extensions #


final now = DateTime.now();

now.format();                                        // 22 Jun 2025
now.short;                                           // 22/06/25
now.time;                                            // 08:30 AM
now.fullDateTime;                                    // 22 Jun 2025, 08:30 AM

now.isToday;                                         // true or false
now.isSameDate(DateTime(2025, 6, 22));               // true

โณ Duration Extension #

Duration(seconds: 75).formatted;       // 01:15

๐Ÿงฑ BuildContext Extensions #

context.width;                         // Screen width
context.height;                        // Screen height

context.theme;                         // ThemeData
context.textTheme.headlineSmall;       // Text style access
context.colorScheme.primary;           // Color access

context.divider;                       // Divider widget
context.spacing(20);                   // SizedBox(height: 20)

context.showSnackbar("Hello!");        // Show snackbar
context.copyToClipboard("Copied!", successMessage: "Text copied"); // Copy to clipboard

context.showLoader(message: "Loading..."); // Show loader
context.hideLoader();                  // Hide loader

๐Ÿ” Navigation Extensions #

context.push(MyNewPage());                  // Push a new page
context.pushReplacement(MyOtherPage());     // Replace current page
context.pop();                               // Go back

await context.withLoadingDialog(
someAsyncFunction(),
message: "Processing..."
); // Show loader while future runs

๐Ÿ“ฆ Iterable Extension #

['apple', 'banana', 'grape'].mapIndexed((i, val) => '$i: $val');
// Output: ['0: apple', '1: banana', '2: grape']

๐ŸŽจ Color Extension #

Colors.blue.toHex();                        // #FF2196F3
Colors.green.toHex(leadingHashSign: false); // FF4CAF50

๐Ÿงฉ Widget Extensions #

Text('Click Me').onTap(() => print('Tapped!'));           // Tap handler

Container().withPaddingAll(8);                                // Padding on all sides
Text('Custom').withPaddingOnly(left: 12, top: 8);             // Specific side padding
Text('Symmetric').withPaddingSymmetric(horizontal: 16); // Horizontal/Vertical
Text('Fade In').fadeIn();                                 // Fade-in animation

Icon(Icons.favorite).tapScale(onTap: () {});              // Tap shrink animation

Text('Soft UI').asNeumorphic();                           // Neumorphic card style

Text('Gradient Card').asGradientCard();                   // Gradient background card

Text('Glass Card').asGlassCard();                         // Frosted glass blur card

Image.asset('pic.png').clipRounded(12);                                       // Clip with corner radius

Image.network(url).clipRounded(12).onImageTapPreview(context, imageProvider: NetworkImage(url)); // Zoomable full preview

'https://picsum.photos/800/300'.asImageCard(
height: 180,
radius: 20,
shadow: true,
onTap: () => print('Image tapped'),
), //resuable image card, (asset,network or file image)


๐Ÿ“ Spacing & EdgeInsets Extensions #

16.spacingY();                     // SizedBox(height: 16)
8.spacingX();                      // SizedBox(width: 8)

12.0.toAll;                        // EdgeInsets.all(12)
10.0.toSymmetric;                 // EdgeInsets.symmetric(horizontal: 10, vertical: 10)

๐Ÿ˜€ Emoji Replacement #

'I love :pizza: and :fries:'.withEmojis();        // I love ๐Ÿ• and ๐ŸŸ
'Greetings from :india:'.withEmojis();            // Greetings from ๐Ÿ‡ฎ๐Ÿ‡ณ

๐Ÿ“‹ Clipboard Utility #

context.copyToClipboard('Secret Key', successMessage: 'Copied to clipboard!');

๐Ÿง  Debug Logging #

'Something went wrong'.log();                     // Logs to debug console
'Page Loaded'.log(tag: 'INIT');                   // [INIT] Page Loaded

๐Ÿงฎ Math Extensions #

Helper extensions to display math expressions cleanly on UI, similar to how they're shown in math books.

Text('Square Value: ${5.square}'),                    // 5ยฒ
Text('Cube Display: ${2.cube}'),                      // 2ยณ
Text('Power UI: ${2.toSuperPower(5)}'),               // 2โต
Text('Power Formula: ${2.asSuperPowerFormula(5)}'),   // 2โต = 32
Text('Root Display: ${16.toRoot(2)}'),                // โˆš16
Text('Root Formula: ${27.asRootFormula(3)}'),         // ยณโˆš27 = 3.0000
Text('Fraction: ${0.25.toFractionSymbol()}'),         // ยผ
Text('Mixed: ${1.75.toMixedFraction()}'),             // 1ยพ
Text('Log Base 2: ${8.asLogFormula(2)}'),             // logโ‚‚(8) = 3.0000

You can format powers, roots, logs, and common fractions in a visually clean and math-friendly way. Ideal for math-based learning or quiz apps.

๐Ÿ“Œ More Coming Soon... #

Weโ€™re continuously improving Mplix โ€“ more utility extensions, emoji packs, and integration widgets are on the way!

1
likes
160
points
56
downloads

Publisher

verified publishermplifytech.com

Weekly Downloads

A collection of useful Flutter and Dart extensions to simplify common tasks.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_spinkit, intl

More

Packages that depend on mplix