dynamic_tools 2.0.1 copy "dynamic_tools: ^2.0.1" to clipboard
dynamic_tools: ^2.0.1 copied to clipboard

Dynamic collection of tools for Flutter development, simplifying usage and some interesting stuff!

Dynamic Tools #

Help with some things in flutter

Usage shortcuts with context #

There's no secret, just an extension to make it easier to get the theme, screen size, scope functions, among others...


Something like this is usually used within the build:

final theme = Theme.of(context);

This can be made easier by looking like this:

Example: #

class ThemeExample extends StatelessWidget {
  const ThemeExample({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      color: context.colorScheme.background,
      child: Center(
        child: Text(
          "Easy",
          style: context.textTheme.bodyMedium,
        ),
      ),
    );
  }
}

Obviously it will only return correctly if you correctly fill in the theme in the Material App!

Something similar happens when getting the screen size:

final sizeScreen = MediaQuery.of(context).size;
final screenHeight = screen.height;

Example: #

class Example extends StatelessWidget {
  const Example({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: context.screenHeight,
      color: context.colorScheme.background,
      child: Center(
        child: Text(
          "Easy",
          style: context.textTheme.bodyMedium,
        ),
      ),
    );
  }
}
1
likes
0
pub points
24%
popularity

Publisher

verified publisherrdrgbaioco.dev

Dynamic collection of tools for Flutter development, simplifying usage and some interesting stuff!

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter, meta

More

Packages that depend on dynamic_tools