dynamic_tools 2.0.4 copy "dynamic_tools: ^2.0.4" to clipboard
dynamic_tools: ^2.0.4 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
150
points
55
downloads

Publisher

verified publisherworkstationti.host

Weekly Downloads

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

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, meta

More

Packages that depend on dynamic_tools