Excellent Programming Tricks

Excellent Programming Tricks Excellent Programming Tricks Programming support, technique and secret tricks for you.

Develop and boost your requirements... Also, illustrate how you evolve your life style.

04/11/2024

Send a message to learn more

23/10/2024

? (Null-aware Operator) Vs ! (Null Assertion Operator)
Null-aware Operator(?) - Safely access a property or method of an object that might be null, without throwing an error if it is null.
String? name; int? length = name?.length; // length will be null if name is null
Null Assertion Operator(!) - A value must not be null; otherwise, it will throw a NoSuchMethodError.
String? name; if (name != null) { print(name!); } // Commonly used when you have checked for null

Send a message to learn more

19/10/2024

What is Predicate?
Is a function return true or false.
What is WidgetBuilder?
It is a function that accepts context(BuildContext) as a parameter and returns dynamic widget(s).
BuildContext VS WidgetBuilder VS ItemBuilder VS Builder [Dynamic nature]
BilderContext - Can allow access to other widgets and properties of the tree. It also holds the location of a widget | object.
WidgetBuilder - Create a new widget (single) based on the BuilderContext | function.
typedef WidgetBuilder = Widget Function(BuildContext context);
ItemBuilder- Create a new list of widgets (ListView, GridView where each item is intexed) based on the BuilderContext location representations | function.
typedef ItemBuilder = Widget Function(BuildContext context, int index);
Builder - Create a new child [widget] using the WidgetBuilder function based on the BuildContext parameter | widget.

https://excellentprogrammingtricks.blogspot.com/2024/10/flutter-tips-and-tricks.html

Send a message to learn more

09/04/2022
08/04/2022

Address

Sydney, NSW

Alerts

Be the first to know and let us send you an email when Excellent Programming Tricks posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Share