dimengen 0.1.0 copy "dimengen: ^0.1.0" to clipboard
dimengen: ^0.1.0 copied to clipboard

Flutter Dimensions Generator

Dimengen β€” Flutter Dimensions Generator #

pub version license: MIT

Dimengen is a SourceGen-based code generator for Flutter that automatically creates EdgeInsets, BorderRadius, SizedBox constants (e.g., sVerticalMBottom, mAll, lOnlyLeft, etc.) based on a custom dimensions class.


Example #

Define your dimension constants inside an annotated class:

import 'package:dimengen/dimengen.dart';

@Dimengen()
abstract final class Dimensions {
  static const double s = 8.0;
  static const double m = 16.0;
  static const double l = 24.0;
}

Then you can simply use them like this:

Padding(
  padding: DimensionsInsets.sVertical,
  child: Text('Example'),
)

Installation

Add to your pubspec.yaml:

dependencies:
  dimengen: ^0.1.0

dev_dependencies:
  build_runner: ^2.4.6

βš™Code Generation

Run:

flutter pub run build_runner build

Or watch for changes:

flutter pub run build_runner watch

Why Use Dimengen?

  • Centralized dimension values
  • Promotes clean, reusable, and consistent UI spacing
  • Automatically generates dozens of EdgeInsets variants
  • Improves code readability and maintainability

🀝 Contributing

Have suggestions or improvements? Feel free to submit a pull request or open an issue. Contributions are welcome!

6
likes
0
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter Dimensions Generator

Repository (GitHub)
View/report issues

Topics

#dimensions #generator #dimengen

License

unknown (license)

Dependencies

analyzer, build, flutter, source_gen

More

Packages that depend on dimengen