pretty_widgets

Creator: coderz1093

Last updated:

0 purchases

pretty_widgets Image
pretty_widgets Images
Add to Cart

Description:

pretty widgets

pretty_widgets #
Pretty Widgets.
Getting started with the Pretty Widgets #
This package is designed to help reduce boilerplate code in your Flutter projects by providing a set of extensions that can be used to simplify common widget hierarchy.
Installation #
To install the package, add the following to your pubspec.yaml
dependencies:
pretty_widgets: <latest version>
copied to clipboard
Then run flutter pub get to get the package installed.
Usage #
Once the package is installed, you can start using the extensions provided by importing the package in your dart
import 'package:pretty_widgets/pretty_widgets.dart';
copied to clipboard
The package includes extensions for common widgets like Text, Padding, that can be used to simplify the code and reduce the number of lines.
For example, you can use the Text('Hii').center() extension to simplify the code for centering a Text wich color widget:
// boilerplate
Center(
child: Text('Hello world'),
)

// simpler
Text('Hello world').center()
copied to clipboard
Simpler right?
Well one line doesn't make much difference, now let's see what happens when you want to do much more styling.
// Long hierarchy and lots of boilerplate
const Padding(
padding: EdgeInsets.all(16.0),
child: Center(
child: Text(
'Hello World',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
),

// Much cleaner way to write the same thing
const Text('Hello World').bold().size(24).center().paddingAll(16),
copied to clipboard
Much cleaner way to get things done!
Conclusion #
By using this package, you can significantly reduce the amount of boilerplate code in your Flutter projects, making your code more readable and maintainable. Try it out and see how it can help you simplify your code.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.