flutter_extend 0.1.0 copy "flutter_extend: ^0.1.0" to clipboard
flutter_extend: ^0.1.0 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 โ€“ The Magical Extensions Toolbox! #

FLUTTER EXTEND

Pub Version License Stars

๐Ÿš€ Welcome to the ultimate Flutter cheat code! This package brings you a collection of mind-blowing extensions that'll make your development experience smoother than a buttered-up otter sliding down a rainbow. ๐ŸŒˆโœจ

๐Ÿ• Why Should You Care? #

Because Flutter Extend makes your life easier, that's why! Instead of writing boring repetitive code, let these extensions do the heavy lifting while you sip on your coffee โ˜• (or energy drink, we donโ€™t judge).

๐Ÿ‘Œ Save time โ€“ Fewer lines of code, more time for memes.
๐Ÿ”„ Write cleaner code โ€“ Your future self will thank you.
๐Ÿง™ Look like a coding wizard โ€“ Impress your teammates.


โš’๏ธ Installation โ€“ Get Started Faster than a Cheetah on Roller Skates #

  1. Summon Flutter Extend into your project by adding this to your pubspec.yaml:
dependencies:
  flutter_extend: ^0.0.6
  1. Run this spell in your terminal:
flutter pub get
  1. Import the package and start your journey to developer enlightenment:
import 'package:flutter_extend/flutter_extend.dart';

BOOM. ๐Ÿ’ฅ Youโ€™re now 10x more powerful (results may vary).


๐Ÿคฏ Behold, The Extensions That Will Blow Your Mind! #

๐ŸŽจ Color Extensions โ€“ For When You Need to Make Things Pretty #

Global Color Extensions (Click to open)
Extension Description
Colors.red.getLighterShade(10) Turns red into diet red (10% lighter)!
Colors.red.toHex() Converts red into that fancy #FF0000 format.

๐Ÿ”ฅ No more googling โ€œFlutter color to hexโ€ like a caveman.


๐Ÿ“ Context Extensions โ€“ Your Appโ€™s Sixth Sense #

๐Ÿง  Context Extensions (Click to reveal the magic!)
Extension Description
context.colorScheme Knows what colors your app is vibing with. ๐ŸŽจ
context.isDarkMode Detects if your app has gone full Sith mode. ๐ŸŒ‘
context.screenHeight Measures how tall your app stands. ๐Ÿ“
context.screenWidth Measures the width, because size matters. ๐Ÿ“
context.theme Retrieves the whole theme like a style guru. ๐Ÿ‘”

๐Ÿ’ก These context extensions always know whatโ€™s up (literally).


๐Ÿ“† DateTime Extensions โ€“ Manipulate Time Like Doctor Strange #

โณ DateTime Comparison Extensions (Click to open)
Extension What It Does
.isToday() Is todayโ€ฆ today? ๐Ÿค”
.isPast() Confirms if your date is ancient. ๐Ÿ“œ
.isFuture() Predicts the futureโ€ฆ kinda. ๐Ÿ”ฎ
.isYesterday() Checks if it was Laundry Day.
.isTomorrow() Future You says hello. ๐Ÿ‘‹
๐Ÿ—“๏ธ DateTime Formatting Extensions (Click to open)
Extension Example Output
.timeAgo() DateTime(2024, 1, 1).timeAgo() "1 year ago"
.timeUntil() DateTime(2026, 1, 1).timeUntil() "in 1 year"
.monthName() DateTime(2024, 1, 1).monthName() "January"
.monthNameShort() DateTime(2024, 1, 1).monthNameShort() "Jan"
.dayName() DateTime(2024, 1, 1).dayName() "Monday"
.dayNameShort() DateTime(2024, 1, 1).dayNameShort() "Mon"
.slashedDate() DateTime(2024, 1, 1).slashedDate() "01/01/2024"
.weekNumber() DateTime(2024, 1, 1).weekNumber() 1
๐Ÿ› ๏ธ DateTime Manipulation Extensions (Click to open)
Extension Example Output
.addDays(days) DateTime(2025, 1, 1).addDays(5) DateTime(2025, 1, 6)
.subtractDays(days) DateTime(2025, 1, 1).subtractDays(5) DateTime(2024, 12, 27)
.addMonths(months) DateTime(2025, 1, 1).addMonths(5) DateTime(2025, 6, 1)
.subtractMonths(months) DateTime(2025, 1, 1).subtractMonths(5) DateTime(2024, 8, 1)
.addYears(years) DateTime(2025, 1, 1).addYears(5) DateTime(2030, 1, 1)
.subtractYears(years) DateTime(2025, 1, 1).subtractYears(5) DateTime(2020, 1, 1)
.addBusinessDays(days) DateTime(2025, 1, 1).addBusinessDays(5) DateTime(2025, 1, 8)

๐Ÿ”„ Master time manipulation and become the Flutter Time Lord!


๐Ÿ“‚ File Extensions โ€“ Handle Files Like a Pro! #

๐Ÿ“ File Extensions (Click to open)
Extension Example Output
.fileFormattedSize() File('path').fileFormattedSize() 500 MB
.filePath() File('path').filePath() /emulated/0/storage...
.fileExtension() File('path').fileExtension() pdf, jpg, etc.
.fileNameWithoutExtension() File('path').fileNameWithoutExtension() myAwesomeFile

๐Ÿ—‚๏ธ Stop wrestling with file paths like itโ€™s 1999!


๐Ÿ“ฆ Generator Extensions โ€“ Auto-Magic String Generation! #

NB: String generator methods should be used on Empty Strings for the best results.

๐Ÿ”  String Generator Extensions (Click to open)
Extension Example Output
.generateLoremIpsum(wordCount) "".generateLoremIpsum(wordCount: 5) Lorem ipsum dolor sit amet
.generateUUID(length) "".generateUUID(length: 10) Random UUID
.generateClipboardContents(textIfNull) "".generateClipboardContents() Returns a String clipboard contents
.generateRandomString(length) "".generateRandomString(10) Random 10-character string

๐Ÿ“ Because manually typing random text is so last year!


๐Ÿ“‹ List Extensions โ€“ Sorting, Chunking, and More! #

๐Ÿ“œ List Extensions (Click to open)
Extension Example Output
.firstOrNull() ["hello", "world", "awesome"].firstOrNull() hello
.lastOrNull() ["hello", "world", "awesome"].lastOrNull() awesome
.sortBy() ["Urus", "BMW", "Aston Martin", "Ferari", "Lambo"].sortBy((car) => car) ["Aston Martin", "BMW", "Ferari", "Lambo", "Urus"]
.sortByAndReturnSorted() ["Urus", "BMW", "Aston Martin", "Ferari", "Lambo"].sortByAndReturnSorted((car) => car) ["Aston Martin", "BMW", "Ferari", "Lambo", "Urus"]
.shuffled() ["Urus", "BMW", "Aston Martin", "Ferari", "Lambo"].shuffled() ["Ferari", "Aston Martin", "BMW", "Lambo", "Urus"]
.chunked(size) ["Urus", "BMW", "Aston Martin", "Ferari", "Lambo"].chunked(2) [['Urus', 'BMW'], ['Aston Martin', 'Ferari'], ['Lambo']]

๐Ÿ“Œ Because sorting lists manually is for mere mortals!


๐Ÿ”ข Number Extensions โ€“ Math is Hard, Letโ€™s Make It Easy #

Number Duration Extensions (Click to open)
Extension Example Output
.days 5.days Duration(days: 5)
.hours 5.hours Duration(hours: 5)
.mins 5.mins Duration(minutes: 5)
.secs 5.secs Duration(seconds: 5)
.milliSecs 5.milliSecs Duration(milliSeconds: 5)
.microSecs 5.microSecs Duration(microSeconds: 5)

๐Ÿง  Because numbers should work for you, not the other way around.


๐Ÿ”ค String Extensions โ€“ Tame Your Text Like a Pro! #

๐Ÿ”‘ Validation String Extensions (Click to open)
Extension Example Output
.isEmailValid() "badEmail.com".isEmailValid() false
.isPasswordValid() "weak12".isPasswordValid() false
.isValidURL() "weirdurl//".isValidURL() false
๐ŸŒ Global String Extensions (Click to open)
Extension Example Output
.capitalizeFirstLetter() "hello".capitalizeFirstLetter() Hello
.capitalizeFirstLetterOfEachWord() "hello world".capitalizeFirstLetterOfEachWord() Hello World
.getLastNCharacters(n) "hello".getLastNCharacters(2) lo
.mask(visibleCount) "helloworld".mask() he******ld
.reverse() "hello".reverse() olleh
.truncateName() "Ken Starry".truncateName() Ken S.
๐Ÿ•ต๏ธ Regex String Extensions (Click to open)
Extension Example Output
.extractDigits() "abc123".extractDigits() "123"
.removeAllDigits() "abc123".removeAllDigits() "abc"
.removeAllWordsStartingWithNumber() "1abc 2def ghi".removeAllWordsStartingWithNumber() "ghi"
.isDigitsOnly() "12345".isDigitsOnly() true
.isTextOnly() "abc".isTextOnly() true
.removeAllWhiteSpaces() "a b c".removeAllWhiteSpaces() "abc"
.getWords() "Hello world!".getWords() ["Hello", "world"]
๐Ÿ”ข String Formatter Extensions (Click to open)
Extension Example Output
.capitalizeFirstLetter() 'hello'.capitalizeFirstLetter() 'Hello'
.toTitleCase() 'hello world'.toTitleCase() 'Hello World'
.toCamelCase() 'hello_world'.toCamelCase() 'helloWorld'
.toSlug() 'Hello World!'.toSlug() 'hello-world'
.toOrdinal() '23'.toOrdinal() '23rd'
.toBase64() 'Hello'.toBase64() 'SGVsbG8='
.fromBase64() 'SGVsbG8='.fromBase64() 'Hello'

๐Ÿ”  Say goodbye to messy text handling forever!


๐Ÿ–ผ๏ธ Widget Extensions โ€“ Supercharge Your Widgets! #

๐Ÿงฉ Widget Extensions (Click to open)
Extension Example Output
clickableMouse Text('Click me').clickableMouse(onTap: () { print('Clicked'); }) A text widget that shows a mouse pointer on hover and prints 'Clicked' on tap.
expanded Text('Expanded').expanded() A text widget wrapped with an Expanded widget.
flexibe Text('Flexible').flexibe() A text widget wrapped with a Flexible widget.
padding Text('Padded').padding(padding: EdgeInsets.all(16)) A text widget with 16 pixels of padding on all sides.
align Text('Aligned').align(alignment: Alignment.centerRight) A text widget aligned to the center right of its parent.
clip Image.network('url').clip(borderRadius: BorderRadius.circular(8)) An image widget clipped with an 8-pixel border radius.
removeScrollbar ListView().removeScrollbar(context) A ListView without a scrollbar.
addScrollbar ListView().addScrollbar(context) A ListView with a scrollbar.
visibility Text('Visible').visibility(visible: false) A text widget that is not visible.
invinsible Text('Invisible').invinsible() A text widget that is not visible.
visible Text('Visible').visible() A text widget that is visible.
addSelectionArea Text('Selectable').addSelectionArea() A text widget that can be selected.
center Text('Centered').center() A text widget centered within its parent.
๐Ÿ› ๏ธ Scaffold Extensions (Click to open)
Extension Example Output
.addAnnotatedRegion() Scaffold().addAnnotatedRegion(statusBarColor: Colors.red, statusBarBrightness: Brightness.dark, navigationBarColor: Colors.blue, navigationBarBrightness: Brightness.light) A Scaffold widget with customized status bar and navigation bar colors and brightness.
๐Ÿ”— Text Extensions (Click to open)
Extension Example Output
.addHyperLinks Text('Click here for more info').addHyperLinks(hyperLinkTexts: ['here'], onHyperlinkClicked: (word) => {}) A Text widget with the word "here" as a hyperlink that triggers the onHyperlinkClicked function.

๐Ÿ–๏ธ Make your widgets do more with less code!


โณ Coming Soon โ€“ The Future is Bright! #

๐Ÿ“ฆ Animation Extensions โ€“ Because Motion is Magic! #

(Coming soonโ€ฆ if I ever stop procrastinating.)


๐Ÿ”– Future Extensions โ€“ Async Like a Boss! #

(Coming soonโ€ฆ after I finish scrolling through cat videos.)


๐ŸŽญ Widget Generators โ€“ The Magic is Brewing! โ˜•๐Ÿ”ฎ #

(Coming soon... currently summoning the code wizards for this one. ๐Ÿง™โ€โ™‚๏ธโœจ)


๐Ÿค Contributors #

A huge shoutout to the amazing people who have contributed to making Flutter Extend even more awesome! ๐ŸŽ‰

KenStarry
KenStarry(Owner)
Enos Okello
Enos Okello

๐Ÿ‘ฅ Want to Contribute? #

๐Ÿ›  Found something cool to add? Fork this repo, create a new branch, and submit a pull request!

๐Ÿ‘พ Join the Fun! We love developers who break things (and then fix them).


๐Ÿ”— Package on pub.flutter-io.cn
๐Ÿ”— GitHub Repo
๐Ÿ“– Flutter Documentation
๐Ÿ“’ Dart Documentation


Examples #

๐Ÿ“š Enough talk, time for action! Want to see these extensions in action? Head over to our **examples directory ** directory and witness the magic firsthand! โœจ ๐Ÿ” See. Try. Enjoy. Repeat.

(Warning: May cause extreme excitement and spontaneous coding sprees.) ๐Ÿ˜†


๐Ÿ License โ€“ Go Wild! #

This package is licensed under MIT, meaning you can use it, modify it, and show it off to your friends. ๐ŸŽ‰


๐ŸŽ‰ Thatโ€™s it, folks! Now go forth and write Flutter code like an absolute legend. ๐Ÿš€๐Ÿ’™

12
likes
0
points
46
downloads

Publisher

unverified uploader

Weekly Downloads

Simple, Efficient Flutter Extensions! Supercharge your Flutter development with a collection of easy-to-use, lightweight, and practical extension methods.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_animate, intl

More

Packages that depend on flutter_extend