Code generation for Flutter Padding widgets based on your constants

Related tags

UI paddinger
Overview

Paddinger

Paddinger is a Flutter package to generate Padding widgets.

Given a set of constants like:

@paddinger
const double PADDING_NORMAL = 8;

A set of Padding classes will be generated like:

NormalAllPadding
NormalLeftPadding
NormalTopPadding
NormalRightPadding
NormalBottomPadding
NormalHorizontalPadding
NormalVerticalPadding
NormalLeftTopPadding
NormalLeftBottomPadding
NormalRightTopPadding
NormalRightBottomPadding

So instead of writing:

Padding(
  padding: const EdgeInsets.all(PADDING_NORMAL),
  child: Text(
    'MyText',
  ),
)

you can just write:

NormalAllPadding(
  child: Text(
    'MyText',
  ),
)

How to use it

  • Add the following as dependencies:
dependencies:
  paddinger_annotations: [latestVersionHere]

dev_dependencies:
  paddinger: [latestVersionHere]
  • Create a file where you will add all your PADDING_ constants, the file could be named paddings.dart.
  • Add your favourite material or cupertino import like:
// ignore: unused_import
import 'package:flutter/material.dart';
  • Add the part directive:
part 'paddings.g.dart';
  • Run the code generation with flutter pub run build_runner build --delete-conflicting-outputs

Have a look at the example app to see it in practice.

Publishing

Dry Run:

flutter packages pub publish --dry-run

To publish:

flutter packages pub publish

You might also like...

A simple package that provides you with some widgets and cutom clippers which implements the shape of a coupon card.

A simple package that provides you with some widgets and cutom clippers which implements the shape of a coupon card.

Coupon UI Kit A simple package that provides you with some widgets and cutom clippers which implements the shape of a coupon card. The example contain

Dec 20, 2022

Display all stand alone widgets in a nice UI

Display all stand alone widgets in a nice UI

flutter_organized_widgets Display all stand alone widgets in a nice UI How to install Add to dependencies: flutter_organized_widgets: git: https

Nov 18, 2022

A highly customisable Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

A highly customisable Flutter widget for entering pin code. Suitable for use cases such as login and OTP.

pin_code_text_field It's a beautiful and highly customizable Flutter widget for entering pin code. Suitable for use cases such as login and OTP. Usage

Dec 28, 2022

Code for the screens created with flutter

Code for the screens created with flutter

FlutterUI-Emojis Code for the screens created with Flutter. Design Credit - https://dribbble.com/shots/9094050-Online-Reservation/attachments/1177787?

Oct 27, 2022

Code for the app created with flutter

Code for the app created with flutter

Curved Design Code for a simple ui screen created with flutter. Design credit - https://dribbble.com/shots/6687016-Foody-Food-by-Subscription How do I

Dec 11, 2022

This is simple Ninja ID Card App Code ;)

ninjacard A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

Oct 17, 2022

A flutter package for building card based forms.

A flutter package for building card based forms.

Card Settings NOTE: THIS IS EFFECTIVELY NULLSAFE BUT CANNOT REFLECT THIS UNTIL cupertino_settings IS UPGRADED. A flutter package for building settings

Dec 26, 2022

Kraken - a high-performance, web standards-compliant rendering engine based on Flutter.

 Kraken - a high-performance, web standards-compliant rendering engine based on Flutter.

Kraken - a high-performance, web standards-compliant rendering engine based on Flutter.

Jan 7, 2023

An UI based flutter project.

An UI based flutter project.

Technoponics Table of Contents About The Project Built With Features Getting Started Roadmap Contact About The Project Technoponics is a app to know a

Mar 15, 2022
Releases(v0.2.0)
Owner
Emanuele
An Android Developer who likes to also explore other worlds. Check me out at https://www.emanuelepapa.dev or read my blog at https://www.w3ma.com
Emanuele
Movies App UI in Flutter using Simple Widgets without Using API's in Flutter.

Movies App UI in Flutter using Simple Widgets without Using API's in Flutter.

Habib ullah 3 May 15, 2022
Flutter Widgets that you can touch and feel

Flutter widgets you haven't used yet. Problems that proximity solves Currently, Flutter has a lot of useful pre-built widgets, no, too many widgets. T

Masahiro Aoki 32 Nov 8, 2022
A Flutter package that enables users to resize the internal widgets by dragging.

resizable_widget ResizableWidget enables users to resize the internal widgets by dragging. This package contains simple APIs, but if needed, you can c

null 35 Dec 2, 2022
🔥 Flutter Widgets 掘金对应专栏,欢迎关注

Flutter Widgets 示例集合 本项目基于 Flutter 2.2.1 版本,是系列 Flutter Widget 示例源码,有对应的文章详细讲解,持续更新敬请关注。 在线预览 全景脑图 持续更新中 掘金专栏 欢迎关注 已完成文章 AnimatedContainer ClipRRect、C

Zero 12 Dec 14, 2022
Build Beautiful UIs with Flutter Widgets

I learnt this following thing from this project How to create Stateless Widgets What is the difference between hot reload and hot refresh and running

Chitraarasu.k 2 Dec 31, 2021
A set of high-level Flutter UI components and stand-alone widgets for easier implementation of most used UI features

A set of high-level Flutter UI components and stand-alone widgets for easier implementation of most used UI features

Evgeny Cherkasov 37 Jul 25, 2022
This package provides some widgets you can use to create a smooshy UI.

Dough Library Squishy widgets for Flutter. Quick Links Dough Demos Here are a few samples of the different widgets provided by this repo. You can find

Josiah Saunders 530 Dec 23, 2022
Responsive Sizer helps implement are responsive layout by providing helper widgets and extensions

Responsive Sizer Responsive Sizer helps implement a responsive layout by providing helper widgets and extensions Content Installation Parameters Take

CoderUni 71 Jan 3, 2023
A wrapper to show a scroll to top prompt to the user on scrollable widgets.

flutter_scroll_to_top A wrapper to show a scroll to top prompt to the user on scrollable widgets. Installing Add the following dependency to your pubs

Naman Shergill 11 May 16, 2022
Allows widgets to be zoomed in and out by inserting a OverlayEntry which allows the widget to be on the front at all times.

zoom_pinch_overlay An instagram style pinch and zoom widget for all platform completely written in pure dart! All other "zoom_pinch" package doesnt di

Samuel 18 Nov 29, 2022