You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.5 KiB
Dart
43 lines
1.5 KiB
Dart
|
|
import 'package:flutter/material.dart';
|
|
|
|
// OWNER : Ibrahim albitar
|
|
// DATE : 05-04-2020
|
|
// DESCRIPTION : Custom widget for rounded container and custom decoration
|
|
|
|
class RoundedContainer extends StatefulWidget {
|
|
|
|
final double raduis;
|
|
final Color backgroundColor;
|
|
final double margin;
|
|
final double elevation;
|
|
final bool showBorder;
|
|
final Color borderColor;
|
|
final Widget widget;
|
|
|
|
RoundedContainer(this.widget ,{this.raduis = 10,this.backgroundColor = Colors.white, this.margin = 10, this.elevation = 1, this.showBorder = false, this.borderColor = Colors.red});
|
|
|
|
@override
|
|
_RoundedContainerState createState() => _RoundedContainerState();
|
|
}
|
|
|
|
class _RoundedContainerState extends State<RoundedContainer> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
margin: EdgeInsets.all(widget.margin),
|
|
decoration: widget.showBorder == true ? BoxDecoration(
|
|
border: Border.all(color: Colors.red, width:1 ),
|
|
borderRadius: BorderRadius.circular(widget.raduis),
|
|
):null,
|
|
child: Card(
|
|
margin: EdgeInsets.all(0),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(widget.raduis),
|
|
),
|
|
color: widget.backgroundColor,
|
|
child: widget.widget ,
|
|
));
|
|
}
|
|
}
|