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

A Dart package to easily use stackable, shorthanded SizedBoxes.

Boxes #

pub package

What is Boxes meant to be #

Boxes is a Flutter package that provides a highly flexible and easy-to-use API for creating and manipulating lists of sized boxes. It allows developers to chain methods to create a series of shorthanded sized boxes with varying dimensions and to treat them as a single Widget.

This package includes two main classes:

  1. ConstSizedBoxes - Contains predefined SizedBox widgets with constant dimensions.
  2. Boxes - Allows chaining methods to create a stack of sized boxes and treat them as a single Widget.

Basic example of boxes creating SizedBox(Width:32, height:12); is Boxes().w32().h12().build();

Features #

  • ⛓️Method chaining for easy creation and manipulation of sized boxes.
  • 📏Predefined sizes for quick usage.
  • 💅🏽Implements List<Widget> to allow seamless integration with Flutter's existing layout widgets.
  • 🧙🏼‍♂️Customizable dimensions.

Installation #

Include boxes in your pubspec.yaml file:

dependencies:
  boxes: ^1.0.2

Run flutter pub get to install the package.

Usage #

import 'package:boxes/boxes.dart';

// Create and manipulate sized boxes
Widget build(BuildContext context) {
  return Column(
    children: [
      Text("First Widget"),
      Boxes().h20().w8().w4().build(),
      Text("Last Widget"),
    ],
  );
}

import 'package:boxes/boxes.dart';
// Use predefined sized boxes
Widget build(BuildContext context) {
  return Column(
    children: [
        ConstSizedBoxes.h8,
        ConstSizedBoxes.w16,
    ],
  );
}

Contributing #

Contributions are welcome! Feel free to open an issue or create a pull request.

License #

This project is licensed under the GoodBoyLicense

4
likes
150
pub points
0%
popularity

Publisher

unverified uploader

A Dart package to easily use stackable, shorthanded SizedBoxes.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on boxes