responsive_ux 1.0.1 copy "responsive_ux: ^1.0.1" to clipboard
responsive_ux: ^1.0.1 copied to clipboard

React to window size changes according to Android/Apple/Material or your own specs. The way you need it.

Library to create Responsive UI more easily

The current state is under active development but is considered stable.

I recommend to take a look at the example project

Features #

Getting started #

dart pub add responsive_ux

Usage #

(see /example folder for a working example and different use cases)

MaterialApp(
    // WindowSizeConfiguration must only be injected for custom boundaries, otherwise defaults are used (check documentation)
    home: WindowSizeConfiguration(
      data: WindowSizeConfigurationData(
      sizes: [WindowSizes.compact]
    ),
    child: BuilderScreen(),
  ),
);
WindowSizedBox(
  builder: (context, width, height, child) {
    String w = "";
    String h = "";

    switch (width) {
      case WindowSizes.compact:
        w = "Compact";
      case WindowSizes.medium:
        w = "Medium";
      case WindowSizes.expanded:
        w = "Expanded";
    }

    switch (height) {
      case WindowSizes.compact:
        h = "Compact";
      case WindowSizes.medium:
        h = "Medium";
      case WindowSizes.expanded:
        h = "Expanded";
    }
    
    print(width.width);   // The WindowSize width boundary that is matched
    print(height.height); // The WindowSize height boundary that is matched

    return Text("W: $w\nH: $h");
  },
);

Additional information #

This package has been developed as Flutter does not has an implementation right now

As the name suggests, we are open for ideas and do not limit this package on what there currently is. Every improvement can be requested and contributed on GitHub.

0
likes
150
points
119
downloads

Publisher

unverified uploader

Weekly Downloads

React to window size changes according to Android/Apple/Material or your own specs. The way you need it.

Repository (GitHub)

Topics

#widget #image #ui #flutter

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on responsive_ux