Last updated:
0 purchases
inbuilt container
Fancy Containers
Inbuilt container is a custom container which can be used in your Flutter app.
Installation
Add the latest version of package to your pubspec.yaml (and rundart pub get):
copied to clipboard
dependencies:
fancy_containers: ^0.0.2
Import the package and use it in your Flutter App.
copied to clipboard
import 'package:inbuilt_container/inbuilt_container.dart';
Example
There are a number of properties that you can modify:
height
width
background color
boarder radius
margin
padding
widget
copied to clipboard
Code
class _CustomContainerState extends State<CustomContainer> {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(widget.boarderRadius ?? 15),
color: widget.bgColor ?? Colors.white,
boxShadow: [
BoxShadow(
color: widget.bgBlurColor ?? Colors.greenAccent,
blurRadius: widget.boarderBlurRadius ?? 2)
]),
height: widget.height ?? MediaQuery.of(context).size.width/2,
width: widget.width ?? MediaQuery.of(context).size.width,
margin: EdgeInsets.all(widget.margin ?? 10),
padding: EdgeInsets.all(widget.padding ?? 10),
child: widget.customWidget ?? Container(),
);
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.