easy_handler 1.0.2 copy "easy_handler: ^1.0.2" to clipboard
easy_handler: ^1.0.2 copied to clipboard

Easy Handler helps you to write shorter syntax

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),
            ),
          ),
        ),

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);

Installation #

Step 1:

dependencies:
  easy_handler: <latest-version>

Step 2:

import 'package:easy_handler/easy_handler.dart';

That's it

Usage #

  @override
  void initState() {
    super.initState();
    afterBuild( () => log("called After Build(context)") );
  }

How to use setProp(value)

style: ButtonStyle(
              backgroundColor: setProp(Colors.purple),
              foregroundColor: setProp(Colors.white),
              elevation: setProp(10),
              padding: setProp(EdgeInsets.all(10)),
            )),

More shoter syntax will be added, Feel free to be a contributor.

8
likes
130
pub points
2%
popularity

Publisher

verified publisherdevhammad.com

Easy Handler helps you to write shorter syntax

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on easy_handler