easy_handler

Creator: coderz1093

Last updated:

0 purchases

easy_handler Image
easy_handler Images

Languages

Categories

Add to Cart

Description:

easy handler

Easy Handler #
Most of the time we use flutter built-in long statement which becomes annoying after some time, here's an example.
1) WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
// Code Implementation.....
});
2) style: ButtonStyle(
backgroundColor: MaterialStateProperty.all(Colors.purple),
foregroundColor: MaterialStateProperty.all(Colors.white),
elevation: MaterialStateProperty.all(10),
padding: MaterialStateProperty.all(
EdgeInsets.symmetric(horizontal: 10),
),
),
),

copied to clipboard
Just to avoid those above long statement, you may use shorter syntax.
//called when layout has been rendered
1) afterBuild(() {})
// value (MaterialStateproperty)
2) setProp(value);
copied to clipboard
Installation #
Step 1:
dependencies:
easy_handler: <latest-version>
copied to clipboard
Step 2:
import 'package:easy_handler/easy_handler.dart';
copied to clipboard
That's it
Usage #
@override
void initState() {
super.initState();
afterBuild( () => log("called After Build(context)") );
}
copied to clipboard
How to use setProp(value)
style: ButtonStyle(
backgroundColor: setProp(Colors.purple),
foregroundColor: setProp(Colors.white),
elevation: setProp(10),
padding: setProp(EdgeInsets.all(10)),
)),
copied to clipboard
More shoter syntax will be added, Feel free to be a contributor.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.