boxes 1.0.2 boxes: ^1.0.2 copied to clipboard
A Dart package to easily use stackable, shorthanded SizedBoxes.
Boxes #
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:
ConstSizedBoxes
- Contains predefinedSizedBox
widgets with constant dimensions.Boxes
- Allows chaining methods to create a stack of sized boxes and treat them as a singleWidget
.
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