decent_container 0.0.1 decent_container: ^0.0.1 copied to clipboard
A Flutter widget for a stylish, customizable container with gradient colors, rounded corners, and shadow—ideal for displaying titles and subtitles effortlessly.flu
Here’s a README.md
for your package that would fit well on pub.dev:
Decorated Container #
A Flutter package providing a customizable, pre-styled container widget with gradient colors, rounded corners, and shadow effects. This widget allows you to quickly implement a stylish container layout for displaying titles and subtitles, simplifying UI design for your Flutter apps.
Features #
- Customizable gradient colors.
- Rounded corners and shadow effects.
- Accepts multiple
AlreadyDecoratedContainer
widgets to easily create a list of decorated containers in a column.
Getting Started #
Add decent_container
as a dependency in your pubspec.yaml
file:
dependencies:
decent_container: ^0.0.1
Usage #
Here's a quick example to get started with DecoratedContainer
and AlreadyDecoratedContainer
.
import 'package:flutter/material.dart';
import 'package:decent_container/decent_container.dart';
class Decorated extends StatelessWidget {
const Decorated({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: DecoratedContainer(
containers: [
AlreadyDecoratedContainer(
title: 'Hello World',
subtitle: 'This is a decorated container',
color1: Colors.blue,
color2: Colors.purple,
textColor: Colors.white,
),
AlreadyDecoratedContainer(
title: 'Another Container',
subtitle: 'With gradient effect',
color1: Colors.orange,
color2: Colors.red,
textColor: Colors.white,
),
],
),
),
);
}
}
Explanation #
- DecoratedContainer: A widget that accepts a list of
AlreadyDecoratedContainer
widgets. - AlreadyDecoratedContainer: A widget with gradient color, rounded corners, and shadow effects to display titles and subtitles.
Properties #
title
: Title text displayed within the container.subtitle
: Subtitle text displayed below the title.color1
,color2
: Colors for the gradient.textColor
: Color of the title and subtitle text.padding
,width
,height
: Customizable layout settings for eachAlreadyDecoratedContainer
.
Example Structure #
DecoratedContainer(
containers: [
AlreadyDecoratedContainer(
title: 'Your Title',
subtitle: 'Your Subtitle',
color1: Colors.green,
color2: Colors.blue,
),
// Add more containers as needed
],
);
License #
This package is licensed under the MIT License. See LICENSE for details.
This README introduces the package, lists its features, provides a usage example, and describes its main properties and structure. It’s designed to help users quickly understand and implement the package.