dynamic_tools 0.0.2 copy "dynamic_tools: ^0.0.2" to clipboard
dynamic_tools: ^0.0.2 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
2%
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