close
The Wayback Machine - https://web.archive.org/web/20211107173904/https://github.com/vandadnp/flutter-tips-and-tricks
Skip to content
main
Switch branches/tags
Code

Files

Permalink
Failed to load latest commit information.

README.md

Table of Contents

Split String by Length in Dart

Source Code

Image

Image Tint in Flutter

Video Demo

Source Code

Image

SlideTransition in Flutter

Video Demo

Source Code

Image

Expansion Panels and Lists in Flutter

Video Demo

Source Code

Image

Complete CRUD App in Flutter

Video Demo

Source Code

Image

SQLite Storage in Flutter

Video Demo

Source Code

Image

Circular Progress with Percentage in Flutter

Video Demo

Source Code

Image

Opening URLs in Flutter

Source Code

Image

Commodore 64 Screen in Flutter

Video Demo

Source Code

Image

Animated Lists in Flutter

Video Demo

Source Code

Image

CheckboxListTile in Flutter

Source Code

Image

- Operator on String in Dart

Source Code

Image

Dart Progress for Future<T>

Source Code

Image

Move Widget Shadows with Animation

Source Code

Image

Gallery with Blurred Backgrounds in Flutter

Source Code

Image

Custom Path Clippers in Flutter

Source Code

Image

Frost Effect on Images in Flutter

Source Code

Image

Custom Clippers in Flutter

Source Code

Image

Check if Website is Up or Down in Dart

Source Code

Image

Section Titles on ListView in Flutter

Source Code

Image

Circular Progress in Flutter

Source Code

Image

Displaying Scroll Wheels in Flutter

Source Code

Image

Post Messages to Slack with Dart

Source Code

Image

Unwrap List<T?>? in Dart

Source Code

Image

Avoiding UI Jitters When Switching Widgets in Flutter

Source Code

Image

Detect Redirects in Dart

Source Code

Image

Proportional Constraints in Flutter

Source Code

Image

Displaying Cupertino Action Sheets in Flutter

Source Code

Image

Rotating List<T> in Dart

Source Code

Image

Displaying SnackBars in Flutter

Source Code

Image

Custom Tab Bar Using ToggleButtons in Flutter

Source Code

Image

Hashable Mixins in Dart

Source Code

Image

Flutter Tips and Tricks in Terminal

Source Code

Image

Searching List<List<T>> in Dart

Source Code

Image

Cloning Objects in Dart

Source Code

Image

Color Filters in Flutter

Source Code

Image

Flattening Lists in Dart

Source Code

Image

Managing Duplicates in List<T> in Dart

Source Code

Image

FlatMap and CompactMap in Dart

Source Code

Image

Equality of List<T> in Dart

Source Code

Image

Constants in Dart

Source Code

Image

Displaying Scrollable Bottom Sheets in Flutter

Source Code

Image

YouTube Ad Remover in Dart

Source Code

Image

Fade Between Widgets in Flutter

Source Code

Image

Sort Descriptors in Dart

Source Code

Image

User Sortable Columns and Tables in Flutter

Source Code

Image

Content-Length of List<Uri> in Dart

Source Code

Image

Recursive Dot Notation on Maps in Dart

Source Code

Image

Allow User Selection of Text in Flutter

Source Code

Image

Placing Constraints on Widgets in Flutter

Source Code

Image

Animating Position Changes in Flutter

Source Code

Image

Transitioning Between Widgets in Flutter

Source Code

Image

Doubly Linked Lists in Dart

Source Code

Image

Reordering Items Inside List Views in Flutter

Source Code

Image

Custom Stream Transformers in Dart

Source Code

Image

Expanding Stream Elements in Dart

Source Code

Image

Consume Streams for a Duration in Dart

Source Code

Image

Shortening URLs in Dart

Source Code

Image

LimitedBox Widget as ListView Items in Flutter

Source Code

Image

Generically Convert Anything to Int in Dart

Source Code

Image

Validating URL Certificates in Dart

Source Code

Image

Displaying Popup Menus in Flutter

Source Code

Image

Implementing Drag and Drop in Flutter

Source Code

Image

Dismissing List Items in Flutter

Source Code

Image

Animating Widgets with Ease in Flutter

Source Code

Image

Displaying Tool Tips in Flutter

Source Code

Image

Displaying Assorted Widgets Inside TableView in Flutter

Source Code

Image

Page Indicator with Page View in Flutter

Source Code

Image

Animating and Moving a Floating Action Button in Flutter

Source Code

Image

Fading Network Image Widget in Flutter

Source Code

Image

Transparent Alert Dialogs in Flutter

Source Code

Image

Network Image Size in Dart

Source Code

Image

Animated Icons in Flutter

Source Code

Image

Custom Scroll Views in Flutter

Source Code

Image

Parallax App Bar in Flutter

Image

JSON HTTP Requests in Dart

Image

URL Timeouts in Dart

Image

Detecting URL File Types in Dart

Image

Paginated Lists in Dart

Image

Requesting DELETE on APIs in Dart

Image

Animated Containers in Flutter

Image

Hiding Widgets in Flutter

Image

Simple Opacity Animation in Flutter

Image

Vignette Widget in Flutter

Image

Drop Down Button Configuration and Usage in Flutter

Image

Expandable List Items in Flutter

Image

Infinite Scrolling in Flutter

Image

Infinite Arrays in Dart

Image

Custom Color Picker Component in Flutter

Image

Displaying and Reacting to Switches in Flutter

Image

Displaying Bottom Bars in Flutter

Image

Displaying Buttons on AppBar in Flutter

Image

Displaying Bottom Sheets in Flutter

Image

Converting Enums to Radio Buttons in Flutter

Image

Check Existence of Websites in Flutter

Image

Images inside AlertDialog in Flutter

Image

Returning Values from AlertDialog in Flutter

Image

Simple Grid View in Flutter

Image

Rendering Bullet Points in Flutter

Image

Retrying Futures in Flutter

Image

Containers as ClipOvals in Flutter

Image

Rich Texts in Flutter

Image

Wrapping Widgets in Flutter

Image

Sweep Gradients in Flutter

Image

Stream and StreamBuilder in Flutter

Image

Blur Effect in Flutter

Image

Convert Enums to Strings in Dart

Image

Replacing Text in TextField in Flutter

Image

Aspect Ratio in Flutter

Image

Zoom and Pan in Flutter

Image

Resizing Images in Flutter to Fit Screen Height

Image

Validating URLs in Flutter

Image

FrameBuilder for Network Images in Flutter

Image

Adding Shadow to Icons in Flutter

Image

Calculating Median of Lists in Dart

Image

Generic Functions with Reduce in Dart

Image

Passing Back Data From a Screen to the Previous One in Flutter

Image

Flinging an Animation in Flutter

Image

Fade Animations in Flutter

Image

Throttling User Input in Flutter

Image

Censoring TextFields in Flutter

Image

Customizing TextButton in Flutter

Image

Multiline TextFields in Flutter

Image

Filtering TextField Input in Flutter

Image

Focusing Manually on TextFields in Flutter

Image

Data Streams Over HTTP/HTTPs in Dart

Image

Catching Nonexistent Accessors or Methods in Dart

Image

Using Expando in Dart

Image

Implementing Custom Maps in Dart

Image

Dynamically Calling Functions in Dart

Image

Factory Constructors in Dart

Image

Calculating the Sum of List Items in Dart

Image

Removing Duplicate Strings in Lists in Dart (Case-Insensitive)

Image

Implementing Range in Dart

Image

Converting Lists to Maps in Dart

Image

Implementing Hashable in Dart

Image

Random Name Generator in Dart

Image

Capturing Stack Traces in Dart Exceptions

Image

Removing Duplicates from Lists in Dart

Image

Optional Spread Operator in Dart

Image

Calling Optional Functions in Dart

Image

Odd-Even Sort in Dart

Image

Implementing Zip and Tuples in Dart

Image

Swapping Values in Lists with XOR in Dart

Image

Waiting for Multiple Futures in Dart

Image

Using Queues as Stacks in Dart

Image

Custom Iterators in Dart

Image

Iterables as Ranges and Transform in Dart

Image

Errors vs Exceptions in Dart

Image

Custom Annotations in Dart

Image

Classes as Enums in Dart

Image

Spread Operator in Collection Literals in Dart

Image

StreamBuilder and StreamController in Dart

Image

Almost Equal in Dart

Image

Enum Associated Values in Dart

Image

Implementing Comparable in Dart

Image

Implementing Custom Integer Types in Dart

Image

Custom Subscripts in Dart

Image

Dart List Enumeration with Index

Image

Applying Mixins to Other Mixins in Dart

Image

Parameter Types in Dart

Image

Custom Exceptions in Dart

Image

rethrowing Exceptions in Dart

Image

mixins and JSON Parsing in Dart

Image

mixins vs abstract classes in Dart

Image

Drawing Shapes in Flutter with LayoutBuilder, CustomPaint and CustomPainter

Image

Generic Type Aliases in Dart

Image

Callable Classes in Dart

Image

Synchronous Generators in Dart

Image

Implicit Interfaces in Dart

Did you know that in #Dart, every #class implicitly exports an #interface that can be #implemented (as opposed to #extended) by other classes? This is called "implicit interface".

Image

Do you know how "const" constructors work in #Dart?

Image

Did you know that in #Dart, it is actually preferred to use #async and #await over using raw #Futures?

Image

In #Dart, you can use a combination of #Initializer #List plus default values for your class #member #fields to create elegant and handy convenience initializers

Image

Did you know that in #Dart, you can extract elements of a certain type from your Lists using the #whereType #generic #function instead of calculating the #equality yourselves?

Image

Do you know about #Type #Promotion in Dart?

"address" is an optional field of the "Person" class. If you look at the "doThis()" function you see that I'm saving the value of address in a local variable and then comparing it with null and then returning if it's null. The Dart compiler is intelligent enough to understand that after the if-statement, "address" is NOT null anymore since you've already compared it with null and returned from the function.

If you look at the "insteadOfThis" function, the first one, the Dart compiler cannot make the same assumption if you don't first store the value of address in a local variable. In that first function the Dart compiler, even after the if-statement, needs you to refer to address as an optional, using "address?" syntax.

The mechanism the Dart compiler uses in the "doThis()" function is called Type Promotion.

Image

4 lines of #Dart code that include the #spread operator, #cascade #operator, #generics, #extensions, #private prefix and #getters

Image

Functions as First Class Citizens in Dart

Image

About

A Collection of Flutter and Dart Tips and Tricks

Resources

Packages

No packages published

Languages